Click to Rate and Give Feedback
MSDN
MSDN Library
.NET Development
Previous Versions
.NET Framework 1.1
.NET Framework
Reference
System.Xml
XmlReader Class
Methods
 LookupNamespace Method
This page is specific to
Microsoft Visual Studio 2003/.NET Framework 1.1

Other versions are also available for the following:
.NET Framework Class Library
XmlReader.LookupNamespace Method

When overridden in a derived class, resolves a namespace prefix in the current element's scope.

[Visual Basic]
Public MustOverride Function LookupNamespace( _
   ByVal prefix As String _
) As String
[C#]
public abstract string LookupNamespace(
 string prefix
);
[C++]
public: virtual String* LookupNamespace(
 String* prefix
) = 0;
[JScript]
public abstract 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, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlReader Class | XmlReader Members | System.Xml Namespace

© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker