Method GetPrefix
GetPrefix(String)
Return one of the prefixes mapped to a Namespace URI.
If more than one prefix is currently mapped to the same URI, this method will make an arbitrary selection; if you want all of the prefixes, use the GetPrefixes() method instead.
Note: this will never return the empty (default) prefix; to check for a default prefix, use the GetUri(String) method with an argument of "".
Declaration
public string GetPrefix(string uri)
Parameters
Type | Name | Description |
---|---|---|
System.String | uri | the namespace URI |
Returns
Type | Description |
---|---|
System.String | one of the prefixes currently mapped to the URI supplied, or null if none is mapped or if the URI is assigned to the default namespace |