Mono Class Library: System.Xml.XmlTextReader Overview | Members

System.Xml.XmlTextReader.LookupNamespace Method

Resolves a namespace prefix in the scope of the current element. [Edit]

public override string LookupNamespace (string prefix)

Parameters

prefix
A string specifying the prefix whose namespace URI is to be resolved. To return the default namespace, specify string.Empty. [Edit]

Returns

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. [Edit]

Exceptions

TypeReason
ArgumentNullExceptionThe XmlTextReader.Namespaces property of the current instance is true and prefix is null. [Edit]

Remarks

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).

[Edit]

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0