Provides access to members that control XML namespaces.
Product Availability
Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.
Members
Description | ||
---|---|---|
AddNamespace | Adds a namespace to the element. | |
DeleteNamespace | Deletes a namespace from the element. | |
NamespaceCount | Number of namespaces. | |
NamespaceURI | The namespace URI for a namespace. | |
Prefix | The namespace prefix for a namespace. |
CoClasses that implement IXMLNamespaces
CoClasses and 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.