getAttributeValue

abstract fun getAttributeValue(index: Int): String

Returns the given attributes value.

Throws an IndexOutOfBoundsException if the index is out of range or current event type is not START_TAG.

NOTE: attribute value must be normalized (including entity replacement text if PROCESS_DOCDECL is false) as described in XML 1.0 section * 3.3.3 Attribute-Value Normalization

Return

value of attribute (null is never returned)

Parameters

index

zero based index of attribute

See also

defineEntityReplacementText

abstract fun getAttributeValue(namespace: String, name: String): String?

Returns the attributes value identified by namespace URI and namespace localName. If namespaces are disabled namespace must be null. If current event type is not START_TAG then IndexOutOfBoundsException will be thrown.

NOTE: attribute value must be normalized (including entity replacement text if PROCESS_DOCDECL is false) as described in XML 1.0 section * 3.3.3 Attribute-Value Normalization

Return

value of attribute or null if attribute with given name does not exist

Parameters

namespace

Namespace of the attribute if namespaces are enabled otherwise must be empty

name

If namespaces enabled local name of attribute otherwise just attribute name