XmlReader::LookupNamespace Method (String^)
.NET Framework (current version)
When overridden in a derived class, resolves a namespace prefix in the current element's scope.
Assembly: System.Xml (in System.Xml.dll)
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.
| Exception | Condition |
|---|---|
| InvalidOperationException | An XmlReader method was called before a previous asynchronous operation finished. In this case, InvalidOperationException is thrown with the message “An asynchronous operation is already in progress.” |
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>
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: