Export (0) Print
Expand All

IXmlNamespaceResolver.LookupNamespace Method

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
Not applicable.

Parameters

prefix

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.

NoteNote:

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.

Prefix

Return Value

xml

http://www.w3.org/XML/1998/namespace

xmlns

http://www.w3.org/2000/xmlns/

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 Server 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 Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

.NET Compact Framework

Supported in: 2.0

XNA Framework

Supported in: 1.0

Community Additions

ADD
Show:
© 2015 Microsoft