Mono Class Library: System.Xml.XmlNamespaceManager Overview | Members

System.Xml.XmlNamespaceManager.AddNamespace Method

Adds the given namespace to the collection of namespaces maintained by the current instance in XmlNamespaceManager.NameTable. [Edit]

public virtual void AddNamespace (string prefix, string uri)

Parameters

prefix
A string specifying the prefix to associate with the namespace being added. Use string.Empty to add a default namespace. [Edit]
uri
A string specifying the namespace to add. [Edit]
uri
Documentation for this section has not yet been entered. [Edit]

Exceptions

TypeReason
ArgumentExceptionprefix is "xml" or "xmlns". [Edit]
ArgumentNullExceptionprefix is null, or uri is null. [Edit]

Remarks

Note:

The same prefix and namespace combination can exist across different scopes.

Operation
As described above.

This method assumes all prefixes and namespaces are valid but does not check prefix and uri for conformance to the W3C specification.

If the specified prefix/namespace combination already exists within the current scope, their string instances will be replaced in XmlNamespaceManager.NameTable with the new string instances of prefix and uri.

Note to Inheritors
Override this method to check prefix and uri for conformance to the W3C specification.

[Edit]

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0