Returns the namespace URI associated with a given prefix.
[Visual Basic] Public Function GetNamespaceOfPrefix( _ ByVal prefix As String _ ) As String [C#] public string GetNamespaceOfPrefix( string prefix ); [C++] public: String* GetNamespaceOfPrefix( String* prefix ); [JScript] public function GetNamespaceOfPrefix( prefix : String ) : String;
The namespace URI associated with the given prefix, or null if this element and its parent elements do not contain a definition of the given prefix.
Exception Type | Condition |
---|---|
ArgumentException | If prefix is null or an empty string. |
This method examines the "xmlns:nnn" attributes of this element and its parent elements to determine the namespace URI associated with the given prefix.
Given an XmlElement with the following text representation:
the GetNamespaceOfPrefix method returns the value "urn:abc-schema" when given the argument "abc".
XmlElement Class | XmlElement Members | System.Xml Namespace | GetPrefixOfNamespace