This documentation is archived and is not being maintained.

XmlWriter.LookupPrefix Method

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

[Visual Basic]
Public MustOverride Function LookupPrefix( _
   ByVal ns As String _
) As String
public abstract string LookupPrefix(
 string ns
public: virtual String* LookupPrefix(
 String* ns
) = 0;
public abstract function LookupPrefix(
   ns : String
) : String;


The namespace URI whose prefix you want to find.

Return Value

The matching prefix or a null reference (Nothing in Visual Basic) if no matching namespace URI is found in the current scope.


Exception Type Condition
ArgumentException ns is either a null reference (Nothing in Visual Basic) or String.Empty.


See LookupPrefix (in the XmlTextWriter class) for an example using this method.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework, Common Language Infrastructure (CLI) Standard

See Also

XmlWriter Class | XmlWriter Members | System.Xml Namespace