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

Returns the prefix associated with a given namespace URI.

[Visual Basic]
Public Function GetPrefixOfNamespace( _
   ByVal ns As String _
) As String
[C#]
public string GetPrefixOfNamespace(
   string ns
);
[C++]
public: String* GetPrefixOfNamespace(
   String* ns
);
[JScript]
public function GetPrefixOfNamespace(
   ns : String
) : String;

Parameters

ns
The namespace URI for which to obtain the prefix.

Return Value

The prefix associated with the given namespace URI, or null if this element and its parent elements do not contain a prefix definition for the namespace.

Exceptions

Exception Type Condition
ArgumentException If ns is null.

Remarks

This method examines the "xmlns:nnn" attributes of this element and its parent elements to determine the prefix associated with the given namespace URI.

Given an XmlElement with the following text representation:



the GetPrefixOfNamespace method returns the value "abc" when given the argument "urn:abc-schema".

See Also

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