This topic has not yet been rated - Rate this topic

XPathNavigator.LookupNamespace Method

Gets the namespace URI for the specified prefix.

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

public virtual string LookupNamespace (
	string prefix
)
public String LookupNamespace (
	String prefix
)
public function LookupNamespace (
	prefix : String
) : String
Not applicable.

Parameters

prefix

The prefix whose namespace URI you want to resolve. To match the default namespace, pass String.Empty.

Return Value

A String that contains the namespace URI assigned to the namespace prefix specified; a null reference (Nothing in Visual Basic) if no namespace URI is assigned to the prefix specified. The String returned is atomized.

If String.Empty is specified as the prefix parameter, the currently assigned default namespace URI is returned. If no default namespace URI is explicitly assigned, and String.Empty is specified as the prefix parameter, the blank prefix is associated with elements that are not in any namespace, and String.Empty is returned.

NoteNote:

The prefix to namespace URI mappings can change from node to node in an XML document. As a result, the value of the LookupNamespace method may not be consistent from one node to the next.

For an example of the LookupNamespace method, see the InsertElementAfter or InsertElementBefore methods.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, 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
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.