Provides access to members that control XML namespaces.
Members
Name | 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. |
IXMLNamespaces.AddNamespace Method
Adds a namespace to the element.
Public Sub AddNamespace ( _
    ByVal Prefix As String, _
    ByVal uri As String _
)
public void AddNamespace (
    string Prefix,
    string uri
);
IXMLNamespaces.DeleteNamespace Method
Deletes a namespace from the element.
Public Sub DeleteNamespace ( _
    ByVal uri As String _
)
public void DeleteNamespace (
    string uri
);
IXMLNamespaces.NamespaceCount Property
Number of namespaces.
Public ReadOnly Property NamespaceCount As Integer
public int NamespaceCount {get;}
IXMLNamespaces.NamespaceURI Property
The namespace URI for a namespace.
Public Function get_NamespaceURI ( _
    ByVal Index As Integer _
) As String
public string get_NamespaceURI (
    int Index
);
IXMLNamespaces.Prefix Property
The namespace prefix for a namespace.
Public Function get_Prefix ( _
    ByVal Index As Integer _
) As String
public string get_Prefix (
    int Index
);
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, theDeleteNamespace method removes the specified namespace by its URI. The NamespaceCount property returns number of namespaces in the list. The Prefix and the NameSpaceURIproperties return the prefix and the URI of the namespace.