# XmlResourceParser

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Inherited Constants](https://developer.android.com/reference/android/content/res/XmlResourceParser#inhconstants)\|[Inherited Fields](https://developer.android.com/reference/android/content/res/XmlResourceParser#inhfields)\|[Methods](https://developer.android.com/reference/android/content/res/XmlResourceParser#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/content/res/XmlResourceParser#inhmethods)  

# XmlResourceParser

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/content/res/XmlResourceParser "View this page in Kotlin")\|Java

`
public


interface
XmlResourceParser
`  
`


implements

`[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet)`,

`[AutoCloseable](https://developer.android.com/reference/java/lang/AutoCloseable)`,

`[XmlPullParser](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser)`


`

|---------------------------------------|
| android.content.res.XmlResourceParser |

<br />

*** ** * ** ***

The XML parsing interface returned for an XML resource. This is a standard[XmlPullParser](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser)interface but also extends[AttributeSet](https://developer.android.com/reference/android/util/AttributeSet)and adds an additional[close()](https://developer.android.com/reference/android/content/res/XmlResourceParser#close())method for the client to indicate when it is done reading the resource.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ### Inherited constants                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[org.xmlpull.v1.XmlPullParser](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser) |--------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | `int`                                                              | [CDSECT](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#CDSECT) A CDATA sections was just read; this token is available only from calls to[nextToken()](https://developer.android.com/reference/android/content/res/XmlResourceParser#nextToken()).                                                                                  | | `int`                                                              | [COMMENT](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#COMMENT) An XML comment was just read.                                                                                                                                                                                                                                      | | `int`                                                              | [DOCDECL](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#DOCDECL) An XML document type declaration was just read.                                                                                                                                                                                                                    | | `int`                                                              | [END_DOCUMENT](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#END_DOCUMENT) Logical end of the xml document.                                                                                                                                                                                                                         | | `int`                                                              | [END_TAG](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#END_TAG) Returned from getEventType(),[next()](https://developer.android.com/reference/android/content/res/XmlResourceParser#next()), or[nextToken()](https://developer.android.com/reference/android/content/res/XmlResourceParser#nextToken())when an end tag was read.   | | `int`                                                              | [ENTITY_REF](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#ENTITY_REF) An entity reference was just read; this token is available from[nextToken()](https://developer.android.com/reference/android/content/res/XmlResourceParser#nextToken())only.                                                                                 | | [String](https://developer.android.com/reference/java/lang/String) | [FEATURE_PROCESS_DOCDECL](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#FEATURE_PROCESS_DOCDECL) This feature determines whether the document declaration is processed.                                                                                                                                                             | | [String](https://developer.android.com/reference/java/lang/String) | [FEATURE_PROCESS_NAMESPACES](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#FEATURE_PROCESS_NAMESPACES) This feature determines whether the parser processes namespaces.                                                                                                                                                             | | [String](https://developer.android.com/reference/java/lang/String) | [FEATURE_REPORT_NAMESPACE_ATTRIBUTES](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#FEATURE_REPORT_NAMESPACE_ATTRIBUTES) This feature determines whether namespace attributes are exposed via the attribute access methods.                                                                                                         | | [String](https://developer.android.com/reference/java/lang/String) | [FEATURE_VALIDATION](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#FEATURE_VALIDATION) If this feature is activated, all validation errors as defined in the XML 1.0 specification are reported.                                                                                                                                    | | `int`                                                              | [IGNORABLE_WHITESPACE](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#IGNORABLE_WHITESPACE) Ignorable whitespace was just read.                                                                                                                                                                                                      | | [String](https://developer.android.com/reference/java/lang/String) | [NO_NAMESPACE](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#NO_NAMESPACE) This constant represents the default namespace (empty string "")                                                                                                                                                                                         | | `int`                                                              | [PROCESSING_INSTRUCTION](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#PROCESSING_INSTRUCTION) An XML processing instruction declaration was just read.                                                                                                                                                                             | | `int`                                                              | [START_DOCUMENT](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#START_DOCUMENT) Signalize that parser is at the very beginning of the document and nothing was read yet.                                                                                                                                                             | | `int`                                                              | [START_TAG](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#START_TAG) Returned from getEventType(),[next()](https://developer.android.com/reference/android/content/res/XmlResourceParser#next()),[nextToken()](https://developer.android.com/reference/android/content/res/XmlResourceParser#nextToken())when a start tag was read. | | `int`                                                              | [TEXT](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#TEXT) Character data was read and will is available by calling getText().                                                                                                                                                                                                      | |

|                                                                                                                                                                                                                                                                                                                                                   ### Inherited fields                                                                                                                                                                                                                                                                                                                                                   |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface[org.xmlpull.v1.XmlPullParser](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser) |---------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` public static final `[String[]](https://developer.android.com/reference/java/lang/String) | [TYPES](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#TYPES) This array can be used to convert the event type integer constants such as START_TAG or TEXT to to a string. | |

|                                                                                                                                  ### Public methods                                                                                                                                  ||
|--------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void`                                                               | ` `[close](https://developer.android.com/reference/android/content/res/XmlResourceParser#close())`() ` Close this parser.                                                                            |
| ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getAttributeNamespace](https://developer.android.com/reference/android/content/res/XmlResourceParser#getAttributeNamespace(int))`(int index) ` Returns the namespace of the specified attribute. |

| ### Inherited methods |
|-----------------------|---|
| From interface` `[android.util.AttributeSet](https://developer.android.com/reference/android/util/AttributeSet)` ` |--------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract boolean`                                                            | ` `[getAttributeBooleanValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeBooleanValue(java.lang.String,%20java.lang.String,%20boolean))`(`[String](https://developer.android.com/reference/java/lang/String)` namespace, `[String](https://developer.android.com/reference/java/lang/String)` attribute, boolean defaultValue) ` Return the boolean value of 'attribute'.                                                                                                                    | | ` abstract boolean`                                                            | ` `[getAttributeBooleanValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeBooleanValue(int,%20boolean))`(int index, boolean defaultValue) ` Return the boolean value of attribute at 'index'.                                                                                                                                                                                                                                                                                                 | | ` abstract int`                                                                | ` `[getAttributeCount](https://developer.android.com/reference/android/util/AttributeSet#getAttributeCount())`() ` Returns the number of attributes available in the set.                                                                                                                                                                                                                                                                                                                                                       | | ` abstract float`                                                              | ` `[getAttributeFloatValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeFloatValue(int,%20float))`(int index, float defaultValue) ` Return the float value of attribute at 'index'.                                                                                                                                                                                                                                                                                                           | | ` abstract float`                                                              | ` `[getAttributeFloatValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeFloatValue(java.lang.String,%20java.lang.String,%20float))`(`[String](https://developer.android.com/reference/java/lang/String)` namespace, `[String](https://developer.android.com/reference/java/lang/String)` attribute, float defaultValue) ` Return the float value of 'attribute'.                                                                                                                              | | ` abstract int`                                                                | ` `[getAttributeIntValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeIntValue(java.lang.String,%20java.lang.String,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` namespace, `[String](https://developer.android.com/reference/java/lang/String)` attribute, int defaultValue) ` Return the integer value of 'attribute'.                                                                                                                                    | | ` abstract int`                                                                | ` `[getAttributeIntValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeIntValue(int,%20int))`(int index, int defaultValue) ` Return the integer value of attribute at 'index'.                                                                                                                                                                                                                                                                                                                 | | ` abstract int`                                                                | ` `[getAttributeListValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeListValue(int,%20java.lang.String[],%20int))`(int index, `[String[]](https://developer.android.com/reference/java/lang/String)` options, int defaultValue) ` Return the index of the value of attribute at 'index' in the list 'options'.                                                                                                                                                                              | | ` abstract int`                                                                | ` `[getAttributeListValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeListValue(java.lang.String,%20java.lang.String,%20java.lang.String[],%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` namespace, `[String](https://developer.android.com/reference/java/lang/String)` attribute, `[String[]](https://developer.android.com/reference/java/lang/String)` options, int defaultValue) ` Return the index of the value of 'attribute' in the list 'options'. | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getAttributeName](https://developer.android.com/reference/android/util/AttributeSet#getAttributeName(int))`(int index) ` Returns the name of the specified attribute.                                                                                                                                                                                                                                                                                                                                                       | | ` abstract int`                                                                | ` `[getAttributeNameResource](https://developer.android.com/reference/android/util/AttributeSet#getAttributeNameResource(int))`(int index) ` Return the resource ID associated with the given attribute name.                                                                                                                                                                                                                                                                                                                   | | ` default `[String](https://developer.android.com/reference/java/lang/String)  | ` `[getAttributeNamespace](https://developer.android.com/reference/android/util/AttributeSet#getAttributeNamespace(int))`(int index) ` Returns the namespace of the specified attribute.                                                                                                                                                                                                                                                                                                                                        | | ` abstract int`                                                                | ` `[getAttributeResourceValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeResourceValue(java.lang.String,%20java.lang.String,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` namespace, `[String](https://developer.android.com/reference/java/lang/String)` attribute, int defaultValue) ` Return the value of 'attribute' as a resource identifier.                                                                                                         | | ` abstract int`                                                                | ` `[getAttributeResourceValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeResourceValue(int,%20int))`(int index, int defaultValue) ` Return the value of attribute at 'index' as a resource identifier.                                                                                                                                                                                                                                                                                      | | ` abstract int`                                                                | ` `[getAttributeUnsignedIntValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeUnsignedIntValue(java.lang.String,%20java.lang.String,%20int))`(`[String](https://developer.android.com/reference/java/lang/String)` namespace, `[String](https://developer.android.com/reference/java/lang/String)` attribute, int defaultValue) ` Return the boolean value of 'attribute' that is formatted as an unsigned value.                                                                             | | ` abstract int`                                                                | ` `[getAttributeUnsignedIntValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeUnsignedIntValue(int,%20int))`(int index, int defaultValue) ` Return the integer value of attribute at 'index' that is formatted as an unsigned value.                                                                                                                                                                                                                                                          | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getAttributeValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeValue(int))`(int index) ` Returns the value of the specified attribute as a string representation.                                                                                                                                                                                                                                                                                                                         | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getAttributeValue](https://developer.android.com/reference/android/util/AttributeSet#getAttributeValue(java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` namespace, `[String](https://developer.android.com/reference/java/lang/String)` name) ` Returns the value of the specified attribute as a string representation.                                                                                                                                        | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getClassAttribute](https://developer.android.com/reference/android/util/AttributeSet#getClassAttribute())`() ` Return the value of the "class" attribute or null if there is not one.                                                                                                                                                                                                                                                                                                                                       | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getIdAttribute](https://developer.android.com/reference/android/util/AttributeSet#getIdAttribute())`() ` Return the value of the "id" attribute or null if there is not one.                                                                                                                                                                                                                                                                                                                                                | | ` abstract int`                                                                | ` `[getIdAttributeResourceValue](https://developer.android.com/reference/android/util/AttributeSet#getIdAttributeResourceValue(int))`(int defaultValue) ` Return the integer value of the "id" attribute or defaultValue if there is none.                                                                                                                                                                                                                                                                                      | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getPositionDescription](https://developer.android.com/reference/android/util/AttributeSet#getPositionDescription())`() ` Returns a description of the current position of the attribute set.                                                                                                                                                                                                                                                                                                                                | | ` abstract int`                                                                | ` `[getStyleAttribute](https://developer.android.com/reference/android/util/AttributeSet#getStyleAttribute())`() ` Return the value of the "style" attribute or 0 if there is not one.                                                                                                                                                                                                                                                                                                                                          | ||
| From interface` `[java.lang.AutoCloseable](https://developer.android.com/reference/java/lang/AutoCloseable)` ` |------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void` | ` `[close](https://developer.android.com/reference/java/lang/AutoCloseable#close())`() ` Closes this resource, relinquishing any underlying resources. | ||
| From interface` `[org.xmlpull.v1.XmlPullParser](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser)` ` |--------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract void`                                                               | ` `[defineEntityReplacementText](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#defineEntityReplacementText(java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` entityName, `[String](https://developer.android.com/reference/java/lang/String)` replacementText) ` Set new value for entity replacement text as defined in[XML 1.0 Section 4.5 Construction of Internal Entity Replacement Text](http://www.w3.org/TR/REC-xml#intern-replacement). | | ` abstract int`                                                                | ` `[getAttributeCount](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getAttributeCount())`() ` Returns the number of attributes of the current start tag, or -1 if the current event type is not START_TAG                                                                                                                                                                                                                                                                                                  | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getAttributeName](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getAttributeName(int))`(int index) ` Returns the local name of the specified attribute if namespaces are enabled or just attribute name if namespaces are disabled.                                                                                                                                                                                                                                                                     | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getAttributeNamespace](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getAttributeNamespace(int))`(int index) ` Returns the namespace URI of the attribute with the given index (starts from 0).                                                                                                                                                                                                                                                                                                         | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getAttributePrefix](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getAttributePrefix(int))`(int index) ` Returns the prefix of the specified attribute Returns null if the element has no prefix.                                                                                                                                                                                                                                                                                                       | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getAttributeType](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getAttributeType(int))`(int index) ` Returns the type of the specified attribute If parser is non-validating it MUST return CDATA.                                                                                                                                                                                                                                                                                                      | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getAttributeValue](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getAttributeValue(java.lang.String,%20java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` namespace, `[String](https://developer.android.com/reference/java/lang/String)` name) ` Returns the attributes value identified by namespace URI and namespace localName.                                                                                                                               | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getAttributeValue](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getAttributeValue(int))`(int index) ` Returns the given attributes value.                                                                                                                                                                                                                                                                                                                                                              | | ` abstract int`                                                                | ` `[getColumnNumber](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getColumnNumber())`() ` Returns the current column number, starting from 1.                                                                                                                                                                                                                                                                                                                                                              | | ` abstract int`                                                                | ` `[getDepth](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getDepth())`() ` Returns the current depth of the element.                                                                                                                                                                                                                                                                                                                                                                                      | | ` abstract int`                                                                | ` `[getEventType](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getEventType())`() ` Returns the type of the current event (START_TAG, END_TAG, TEXT, etc.)                                                                                                                                                                                                                                                                                                                                                 | | ` abstract boolean`                                                            | ` `[getFeature](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getFeature(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` name) ` Returns the current value of the given feature.                                                                                                                                                                                                                                                                                   | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getInputEncoding](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getInputEncoding())`() ` Returns the input encoding if known, null otherwise.                                                                                                                                                                                                                                                                                                                                                           | | ` abstract int`                                                                | ` `[getLineNumber](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getLineNumber())`() ` Returns the current line number, starting from 1.                                                                                                                                                                                                                                                                                                                                                                    | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getName](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getName())`() ` For START_TAG or END_TAG events, the (local) name of the current element is returned when namespaces are enabled.                                                                                                                                                                                                                                                                                                                | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getNamespace](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getNamespace())`() ` Returns the namespace URI of the current element.                                                                                                                                                                                                                                                                                                                                                                      | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getNamespace](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getNamespace(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` prefix) ` Returns the URI corresponding to the given prefix, depending on current state of the parser.                                                                                                                                                                                                                                | | ` abstract int`                                                                | ` `[getNamespaceCount](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getNamespaceCount(int))`(int depth) ` Returns the numbers of elements in the namespace stack for the given depth.                                                                                                                                                                                                                                                                                                                      | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getNamespacePrefix](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getNamespacePrefix(int))`(int pos) ` Returns the namespace prefix for the given position in the namespace stack.                                                                                                                                                                                                                                                                                                                      | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getNamespaceUri](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getNamespaceUri(int))`(int pos) ` Returns the namespace URI for the given position in the namespace stack If the position is out of range, an exception is thrown.                                                                                                                                                                                                                                                                       | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getPositionDescription](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getPositionDescription())`() ` Returns a short text describing the current parser state, including the position, a description of the current event and the data source if known.                                                                                                                                                                                                                                                 | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getPrefix](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getPrefix())`() ` Returns the prefix of the current element.                                                                                                                                                                                                                                                                                                                                                                                   | | ` abstract `[Object](https://developer.android.com/reference/java/lang/Object) | ` `[getProperty](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getProperty(java.lang.String))`(`[String](https://developer.android.com/reference/java/lang/String)` name) ` Look up the value of a property.                                                                                                                                                                                                                                                                                                | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[getText](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getText())`() ` Returns the text content of the current event as String.                                                                                                                                                                                                                                                                                                                                                                         | | ` abstract char[]`                                                             | ` `[getTextCharacters](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getTextCharacters(int[]))`(int[] holderForStartAndLength) ` Returns the buffer that contains the text of the current event, as well as the start offset and length relevant for the current event.                                                                                                                                                                                                                                     | | ` abstract boolean`                                                            | ` `[isAttributeDefault](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#isAttributeDefault(int))`(int index) ` Returns if the specified attribute was not in input was declared in XML.                                                                                                                                                                                                                                                                                                                       | | ` abstract boolean`                                                            | ` `[isEmptyElementTag](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#isEmptyElementTag())`() ` Returns true if the current event is START_TAG and the tag is degenerated (e.g. \<foobar/\>).                                                                                                                                                                                                                                                                                                                | | ` abstract boolean`                                                            | ` `[isWhitespace](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#isWhitespace())`() ` Checks whether the current TEXT event contains only whitespace characters.                                                                                                                                                                                                                                                                                                                                             | | ` abstract int`                                                                | ` `[next](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#next())`() ` Get next parsing event - element content will be coalesced and only one TEXT event must be returned for whole element content (comments and processing instructions will be ignored and entity references must be expanded or exception must be thrown if entity reference can not be expanded).                                                                                                                                       | | ` abstract int`                                                                | ` `[nextTag](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#nextTag())`() ` Call next() and return event if it is START_TAG or END_TAG otherwise throw an exception.                                                                                                                                                                                                                                                                                                                                         | | ` abstract `[String](https://developer.android.com/reference/java/lang/String) | ` `[nextText](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#nextText())`() ` If current event is START_TAG then if next element is TEXT then element content is returned or if next event is END_TAG then empty string is returned, otherwise exception is thrown.                                                                                                                                                                                                                                          | | ` abstract int`                                                                | ` `[nextToken](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#nextToken())`() ` This method works similarly to next() but will expose additional event types (COMMENT, CDSECT, DOCDECL, ENTITY_REF, PROCESSING_INSTRUCTION, or IGNORABLE_WHITESPACE) if they are available in input.                                                                                                                                                                                                                         | | ` abstract void`                                                               | ` `[require](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#require(int,%20java.lang.String,%20java.lang.String))`(int type, `[String](https://developer.android.com/reference/java/lang/String)` namespace, `[String](https://developer.android.com/reference/java/lang/String)` name) ` Test if the current event is of the given type and if the namespace and name do match.                                                                                                                             | | ` abstract void`                                                               | ` `[setFeature](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#setFeature(java.lang.String,%20boolean))`(`[String](https://developer.android.com/reference/java/lang/String)` name, boolean state) ` Use this call to change the general behaviour of the parser, such as namespace processing or doctype declaration handling.                                                                                                                                                                              | | ` abstract void`                                                               | ` `[setInput](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#setInput(java.io.Reader))`(`[Reader](https://developer.android.com/reference/java/io/Reader)` in) ` Set the input source for parser to the given reader and resets the parser.                                                                                                                                                                                                                                                                  | | ` abstract void`                                                               | ` `[setInput](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#setInput(java.io.InputStream,%20java.lang.String))`(`[InputStream](https://developer.android.com/reference/java/io/InputStream)` inputStream, `[String](https://developer.android.com/reference/java/lang/String)` inputEncoding) ` Sets the input stream the parser is going to process.                                                                                                                                                       | | ` abstract void`                                                               | ` `[setProperty](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#setProperty(java.lang.String,%20java.lang.Object))`(`[String](https://developer.android.com/reference/java/lang/String)` name, `[Object](https://developer.android.com/reference/java/lang/Object)` value) ` Set the value of a property.                                                                                                                                                                                                    | ||

## Public methods

### close

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract void close ()
```

Close this parser. Calls on the interface are no longer valid after this call.

<br />

### getAttributeNamespace

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public abstract String getAttributeNamespace (int index)
```

Returns the namespace of the specified attribute.

See also[XmlPullParser.getAttributeNamespace()](https://developer.android.com/reference/org/xmlpull/v1/XmlPullParser#getAttributeNamespace(int)), which this method corresponds to when parsing a compiled XML file.

<br />

<br />

|                             Parameters                              ||
|---------|------------------------------------------------------------|
| `index` | `int`: Index of the desired attribute, 0...count-1. <br /> |

|                                                                                 Returns                                                                                 ||
|--------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | A String containing the namespace of the attribute, or null if th attribute cannot be found. <br /> |