This documentation is archived and is not being maintained.

XmlValidatingReader.LookupNamespace Method

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: String* LookupNamespace(
 String* prefix
);
[JScript]
public override function LookupNamespace(
   prefix : String
) : String;

Parameters

prefix
The prefix whose namespace URI 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 URI to which the prefix maps or a null reference (Nothing in Visual Basic) if no matching prefix is found.

Remarks

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

In the preceding XML, if the reader is positioned on the href attribute, the prefix a is resolved by calling reader.LookupNamesapce("a"). The returned string is urn:456.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

XmlValidatingReader Class | XmlValidatingReader Members | System.Xml Namespace

Show: