Udostępnij za pośrednictwem


IXmlPullParser.GetAttributeNamespace(Int32) Method

Definition

Returns the namespace URI of the attribute with the given index (starts from 0).

[Android.Runtime.Register("getAttributeNamespace", "(I)Ljava/lang/String;", "GetGetAttributeNamespace_IHandler:Org.XmlPull.V1.IXmlPullParserInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public string? GetAttributeNamespace (int index);
[<Android.Runtime.Register("getAttributeNamespace", "(I)Ljava/lang/String;", "GetGetAttributeNamespace_IHandler:Org.XmlPull.V1.IXmlPullParserInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member GetAttributeNamespace : int -> string

Parameters

index
Int32

zero-based index of attribute

Returns

attribute namespace, empty string ("") is returned if namespaces processing is not enabled or namespaces processing is enabled but attribute has no namespace (it has no prefix).

Attributes

Remarks

Returns the namespace URI of the attribute with the given index (starts from 0). Returns an empty string ("") if namespaces are not enabled or the attribute has no namespace. Throws an IndexOutOfBoundsException if the index is out of range or the current event type is not START_TAG.

<strong>NOTE:</strong> if FEATURE_REPORT_NAMESPACE_ATTRIBUTES is set then namespace attributes (xmlns:ns='...') must be reported with namespace http://www.w3.org/2000/xmlns/ (visit this URL for description!). The default namespace attribute (xmlns="...") will be reported with empty namespace.

<strong>NOTE:</strong>The xml prefix is bound as defined in Namespaces in XML specification to "http://www.w3.org/XML/1998/namespace".

Java documentation for org.xmlpull.v1.XmlPullParser.getAttributeNamespace(int).

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