Package com.google.android.exoplayer2.util

## Class XmlPullParserUtil

- java.lang.Object
- - com.google.android.exoplayer2.util.XmlPullParserUtil

-     public final class XmlPullParserUtil
      extends Object

  `XmlPullParser` utility methods.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static String` | `getAttributeValue​(XmlPullParser xpp, String attributeName)` | Returns the value of an attribute of the current start tag.
    `static String` | `getAttributeValueIgnorePrefix​(XmlPullParser xpp, String attributeName)` | Returns the value of an attribute of the current start tag.
    `static boolean` | `isEndTag​(XmlPullParser xpp)` | Returns whether the current event is an end tag.
    `static boolean` | `isEndTag​(XmlPullParser xpp, String name)` | Returns whether the current event is an end tag with the specified name.
    `static boolean` | `isStartTag​(XmlPullParser xpp)` | Returns whether the current event is a start tag.
    `static boolean` | `isStartTag​(XmlPullParser xpp, String name)` | Returns whether the current event is a start tag with the specified name.
    `static boolean` | `isStartTagIgnorePrefix​(XmlPullParser xpp, String name)` | Returns whether the current event is a start tag with the specified name.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### isEndTag

          public static boolean isEndTag​(XmlPullParser xpp,
                                         String name)
                                  throws XmlPullParserException

      Returns whether the current event is an end tag with the specified name.
      Parameters:
        `xpp` - The `XmlPullParser` to query.
        `name` - The specified name.
      Returns:
        Whether the current event is an end tag with the specified name.
      Throws:
        `XmlPullParserException` - If an error occurs querying the parser.

    - #### isEndTag

          public static boolean isEndTag​(XmlPullParser xpp)
                                  throws XmlPullParserException

      Returns whether the current event is an end tag.
      Parameters:
        `xpp` - The `XmlPullParser` to query.
      Returns:
        Whether the current event is an end tag.
      Throws:
        `XmlPullParserException` - If an error occurs querying the parser.

    - #### isStartTag

          public static boolean isStartTag​(XmlPullParser xpp,
                                           String name)
                                    throws XmlPullParserException

      Returns whether the current event is a start tag with the specified name.
      Parameters:
        `xpp` - The `XmlPullParser` to query.
        `name` - The specified name.
      Returns:
        Whether the current event is a start tag with the specified name.
      Throws:
        `XmlPullParserException` - If an error occurs querying the parser.

    - #### isStartTag

          public static boolean isStartTag​(XmlPullParser xpp)
                                    throws XmlPullParserException

      Returns whether the current event is a start tag.
      Parameters:
        `xpp` - The `XmlPullParser` to query.
      Returns:
        Whether the current event is a start tag.
      Throws:
        `XmlPullParserException` - If an error occurs querying the parser.

    - #### isStartTagIgnorePrefix

          public static boolean isStartTagIgnorePrefix​(XmlPullParser xpp,
                                                       String name)
                                                throws XmlPullParserException

      Returns whether the current event is a start tag with the specified name. If the current event has a raw name then its prefix is stripped before matching.
      Parameters:
        `xpp` - The `XmlPullParser` to query.
        `name` - The specified name.
      Returns:
        Whether the current event is a start tag with the specified name.
      Throws:
        `XmlPullParserException` - If an error occurs querying the parser.

    - #### getAttributeValue

          @Nullable
          public static String getAttributeValue​(XmlPullParser xpp,
                                                 String attributeName)

      Returns the value of an attribute of the current start tag.
      Parameters:
        `xpp` - The `XmlPullParser` to query.
        `attributeName` - The name of the attribute.
      Returns:
        The value of the attribute, or null if the current event is not a start tag or if no such attribute was found.

    - #### getAttributeValueIgnorePrefix

          @Nullable
          public static String getAttributeValueIgnorePrefix​(XmlPullParser xpp,
                                                             String attributeName)

      Returns the value of an attribute of the current start tag. Any raw attribute names in the current start tag have their prefixes stripped before matching.
      Parameters:
        `xpp` - The `XmlPullParser` to query.
        `attributeName` - The name of the attribute.
      Returns:
        The value of the attribute, or null if the current event is not a start tag or if no such attribute was found.