This document is archived and information here might be outdated.  Recommended version.


IXMLNamespaces Interface (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > System > ESRI.ArcGIS.esriSystem > Interfaces > IX > IXMLNamespaces Interface
ArcGIS Developer Help

IXMLNamespaces Interface

Provides access to members that control XML namespaces.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Name Description
Method AddNamespace Adds a namespace to the element.
Method DeleteNamespace Deletes a namespace from the element.
Read-only property NamespaceCount Number of namespaces.
Read-only property NamespaceURI The namespace URI for a namespace.
Read-only property Prefix The namespace prefix for a namespace.

Classes that implement IXMLNamespaces

Classes Description
XMLNamespaces A collection of XML namespace declarations.

Remarks


Very often a name conflict might occur when two different xml documents use the same name describing two different elements. This is caused because XML element names are not fixed. To avoid this conflict prefix can precede an element name.

For example,
there are two elements <test></test> and <test></test>  in XML document. Prefix is used to make these elements different: <f:test></f:test> and <h:test></h:test>

The namespace attribute is placed in the start tag of an element and has the following syntax: xmlns:prefix="namespace"

For example,
<f:test xmlns:f="xml test">
</f:test>

where "f" is a namespace prefix, and "xml test" is a namespace URI (Unique Resource Identifier).

Use the AddNamespace method to add new napespaces (prefix and namespace URI) to the element, the DeleteNamespace method removes the specified namespace by its URI. The NamespaceCount property returns number of namespaces in the list. The Prefix and the NameSpaceURI properties return the prefix and the URI of the namespace.