XmlWriter.LookupPrefix Method (String)


When overridden in a derived class, returns the closest prefix defined in the current namespace scope for the namespace URI.

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

abstract LookupPrefix : 
        ns:string -> string


Type: System.String

The namespace URI whose prefix you want to find.

Return Value

Type: System.String

The matching prefix or null if no matching namespace URI is found in the current scope.

Exception Condition

ns is either null or String.Empty.


An XmlWriter 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.”

The following example writes out a book.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Return to top