getAttributeNamespace

abstract fun getAttributeNamespace(index: Int): String?

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.

NOTE: 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.

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

Return

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

Parameters

index

zero-based index of attribute