Resolves a namespace prefix in the scope of the current element.
- prefix
- A string specifying the prefix whose namespace URI is to be resolved. To return the default namespace, specify string.Empty.
A string containing the namespace URI to which the prefix maps. If XmlTextReader.Namespaces is false, prefix is not in XmlTextReader.NameTable, or no matching namespace is found, null is returned.
Type Reason ArgumentNullException The XmlTextReader.Namespaces property of the current instance is true and prefix is null.
Note:In the following XML, if the reader is positioned on the href attribute, the prefix "a" is resolved by calling XmlTextReader.LookupNamespace(string)("a"). The returned string is "urn:456".
<root xmlns:a="urn:456">
<item>
<ref href="a:b"/>
</item>
</root>This method overrides XmlReader.LookupNamespace(string).
Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0