System.Xml.XmlNamespaceManager.LookupPrefix Method

Finds the prefix declared for the given namespace URI.

Syntax

public virtual string LookupPrefix (string uri)

Parameters

uri
The namespace to resolve for the prefix.

Returns

The matching prefix. If there is no mapped prefix, the method returns String.Empty. If a null value is supplied, then null is returned.

Remarks

This method finds the mapped prefix by walking the stack (that is, it looks globally). The supplied string must be atomized for the lookup to succeed. In other words, the supplied string object must exist in the namespace manager's name table (XmlNamespaceManager.NameTable).

The returned string is also atomized. For more information on atomized strings, see the System.Xml.XmlNameTable class.

Requirements

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