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


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.


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

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.


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