Expand Minimize

XmlReader.LookupNamespace Method

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

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

public abstract string LookupNamespace(
	string prefix
)

Parameters

prefix
Type: System.String
The prefix whose namespace URI you want to resolve. To match the default namespace, pass an empty string.

Return Value

Type: System.String
The namespace URI to which the prefix maps or null if no matching prefix is found.

In the following XML string, if the reader is positioned on the href attribute, the prefix a is resolved by calling reader.LookupNamespace("a"). The returned string is urn:456.

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

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2015 Microsoft