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!

XmlTextReader.LookupNamespace

Resolves a namespace prefix in the current element's scope.

[Visual Basic]
Overrides Public Function LookupNamespace( _
   ByVal prefix As String _
) As String
[C#]
public override string LookupNamespace(
   string prefix
);
[C++]
public: override String* LookupNamespace(
   String* prefix
);
[JScript]
public override function LookupNamespace(
   prefix : String
) : String;

Parameters

prefix
The prefix whose namespace URN you want to resolve. To match the default namespace, pass an empty string. This string does not have to be atomized.

Return Value

The namespace URN that the prefix maps to. a null reference (in Visual Basic Nothing) if no matching prefix is found.

Remarks

For example, suppose you have the following XML:

<root xmlns:a="urn:456">
    <item>
        <ref href="a:b"/>
    </item>
</root>

When you read the href attribute with the value "a:b", you can resolve the prefix "a" by calling LookupNamespace ("a"). The returned string will be "urn:456".

See Also

XmlTextReader Class | XmlTextReader Members | System.NewXml Namespace