Android Utililty Methods XmlPullParser Read

List of utility methods to do XmlPullParser Read

Description

The list of methods to do XmlPullParser Read are organized into topic(s).

Method

StringreadStringAttribute(XmlPullParser in, String name)
read String Attribute
return in.getAttributeValue(null, name);
StringreadText(XmlPullParser parser)
read Text
String value = null;
while (parser.next() != XmlPullParser.END_TAG) {
    if (parser.getEventType() == XmlPullParser.END_DOCUMENT) {
        throw new XmlPullParserException(
                "reached unexpected end of document");
    } else if (parser.getEventType() != XmlPullParser.TEXT) {
        continue;
    String text = parser.getText();
    value = textOf(text);
return value;
StringreadText(XmlPullParser parser)
read Text
String result = "";
if (parser.next() == XmlPullParser.TEXT) {
    result = parser.getText();
    parser.nextTag();
return result;
StringreadText(XmlPullParser parser)
read Text
String result = "";
if (parser.next() == XmlPullParser.TEXT) {
    result = parser.getText();
    parser.nextTag();
return result;
StringreadText(XmlPullParser parser)
read Text
String result = "";
if (parser.next() == XmlPullParser.TEXT) {
    result = parser.getText();
    parser.nextTag();
return result;
StringreadText(XmlPullParser parser, String tagName)
Reads a String from the next xml tag
String result = "";
parser.require(XmlPullParser.START_TAG, NAMESPACE, tagName);
if (parser.next() == XmlPullParser.TEXT) {
    result = parser.getText();
    parser.nextTag();
parser.require(XmlPullParser.END_TAG, NAMESPACE, tagName);
return result;
...
double[]readThisDoubleArrayXml( XmlPullParser parser, String endTag, String[] name)
Read a double[] object from an XmlPullParser.
int num;
try {
    num = Integer.parseInt(parser.getAttributeValue(null, "num"));
} catch (NullPointerException e) {
    throw new XmlPullParserException(
            "Need num attribute in double-array");
} catch (NumberFormatException e) {
    throw new XmlPullParserException(
...
double[]readThisDoubleArrayXml(XmlPullParser parser, String endTag, String[] name)
Read a double[] object from an XmlPullParser.
int num;
try {
    num = Integer.parseInt(parser.getAttributeValue(null, "num"));
} catch (NullPointerException e) {
    throw new XmlPullParserException(
            "Need num attribute in double-array");
} catch (NumberFormatException e) {
    throw new XmlPullParserException(
...
int[]readThisIntArrayXml(XmlPullParser parser, String endTag, String[] name)
Read an int[] object from an XmlPullParser.
int num;
try {
    num = Integer.parseInt(parser.getAttributeValue(null, "num"));
} catch (NullPointerException e) {
    throw new XmlPullParserException(
            "Need num attribute in byte-array");
} catch (NumberFormatException e) {
    throw new XmlPullParserException(
...
int[]readThisIntArrayXml(XmlPullParser parser, String endTag, String[] name)
Read an int[] object from an XmlPullParser.
int num;
try {
    num = Integer.parseInt(parser.getAttributeValue(null, "num"));
} catch (NullPointerException e) {
    throw new XmlPullParserException(
            "Need num attribute in byte-array");
} catch (NumberFormatException e) {
    throw new XmlPullParserException(
...