This documentation is archived and is not being maintained.

IXmlNamespaceResolver.LookupNamespace Method

Note: This method is new in the .NET Framework version 2.0.

Gets the namespace URI mapped to the specified prefix.

Namespace: System.Xml
Assembly: System.Xml (in system.xml.dll)

string LookupNamespace (
	string prefix
String LookupNamespace (
	String prefix
function LookupNamespace (
	prefix : String
) : String



The prefix whose namespace URI you wish to find.

Return Value

The namespace URI that is mapped to the prefix; a null reference (Nothing in Visual Basic) if the prefix is not mapped to a namespace URI.


Namespace URI-to-prefix mappings can change from node to node in an XML document. You cannot depend on the result of a lookup being consistent from one node to the next.

The following table describes how the default and built-in namespaces are handled by the LookupNamespace method.


Return Value



String.Empty (A default namespace has been assigned).

The currently assigned default namespace.

String.Empty (The default namespace has not been explicitly assigned).

String.Empty (The blank prefix is associated with elements that are not in any namespace).

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

.NET Compact Framework

Supported in: 2.0