Sdílet prostřednictvím


NamespaceSupport.GetPrefix(String) Method

Definition

Return one of the prefixes mapped to a Namespace URI.

[Android.Runtime.Register("getPrefix", "(Ljava/lang/String;)Ljava/lang/String;", "GetGetPrefix_Ljava_lang_String_Handler")]
public virtual string? GetPrefix (string? uri);
[<Android.Runtime.Register("getPrefix", "(Ljava/lang/String;)Ljava/lang/String;", "GetGetPrefix_Ljava_lang_String_Handler")>]
abstract member GetPrefix : string -> string
override this.GetPrefix : string -> string

Parameters

uri
String

the namespace URI

Returns

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

Attributes

Remarks

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.

<strong>Note:</strong> this will never return the empty (default) prefix; to check for a default prefix, use the #getURI getURI method with an argument of "".

Java documentation for org.xml.sax.helpers.NamespaceSupport.getPrefix(java.lang.String).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also