NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

XmlElement.GetNamespaceOfPrefix

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;

Parameters

prefix
The prefix for which to obtain the namespace URI. This must be a non-null, non-empty string.

Return Value

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.

Exceptions

Exception Type Condition
ArgumentException If prefix is null or an empty string.

Remarks

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".

See Also

XmlElement Class | XmlElement Members | System.Xml Namespace | GetPrefixOfNamespace