com.esri.arcgis.system
Interface IXMLNamespaces

All Superinterfaces:
Serializable
All Known Implementing Classes:
XMLNamespaces

public interface IXMLNamespaces
extends Serializable

Provides access to members that control XML namespaces.

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.

Product Availability

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


Method Summary
 void addNamespace(String prefix, String uri)
          Adds a namespace to the element.
 void deleteNamespace(String uri)
          Deletes a namespace from the element.
 int getNamespaceCount()
          Number of namespaces.
 String getNamespaceURI(int index)
          The namespace URI for a namespace.
 String getPrefix(int index)
          The namespace prefix for a namespace.
 

Method Detail

addNamespace

void addNamespace(String prefix,
                  String uri)
                  throws IOException,
                         AutomationException
Adds a namespace to the element.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
prefix - The prefix (in)
uri - The uri (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

deleteNamespace

void deleteNamespace(String uri)
                     throws IOException,
                            AutomationException
Deletes a namespace from the element.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
uri - The uri (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNamespaceCount

int getNamespaceCount()
                      throws IOException,
                             AutomationException
Number of namespaces.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The count
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getPrefix

String getPrefix(int index)
                 throws IOException,
                        AutomationException
The namespace prefix for a namespace.

Product Availability

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

Parameters:
index - The index (in)
Returns:
The prefix
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getNamespaceURI

String getNamespaceURI(int index)
                       throws IOException,
                              AutomationException
The namespace URI for a namespace.

Product Availability

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

Parameters:
index - The index (in)
Returns:
The uri
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.