Android Utililty Methods XmlPullParser Value Get

List of utility methods to do XmlPullParser Value Get

Description

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

Method

doubleoptFloatAttr(final XmlPullParser pp, final String attrName, final float defaultValue)
opt Float Attr
final String attr = optAttr(pp, attrName, null);
if (attr != null)
    return Double.parseDouble(attr);
else
    return defaultValue;
intoptIntAttr(final XmlPullParser pp, final String attrName, final int defaultValue)
opt Int Attr
final String attr = optAttr(pp, attrName, null);
if (attr != null)
    return Integer.parseInt(attr);
else
    return defaultValue;
voidoptSkip(final XmlPullParser pp, final String tagName)
opt Skip
if (test(pp, tagName))
    requireSkip(pp, tagName);
Stringattr(final XmlPullParser pp, final String attrName)
attr
final String attr = optAttr(pp, attrName, null);
if (attr != null)
    return attr;
else
    throw new IllegalStateException("expecting attribute: "
            + attrName);
voidcopyXML(XmlPullParser xmlPullParser, XmlSerializer xmlSerializer)
Copy an XML fragment from a source (pull parser) to a destination (serializer), pulling all element namespaces into the empty prefix.
int startDepth = xmlPullParser.getDepth();
String namespace = null;
do {
    int type = xmlPullParser.next();
    switch (type) {
    case XmlPullParser.END_TAG:
        xmlSerializer.endTag(xmlPullParser.getNamespace(),
                xmlPullParser.getName());
...
voidexit(final XmlPullParser pp, final String tagName)
exit
pp.require(XmlPullParser.END_TAG, null, tagName);
pp.next();
doublefloatAttr(final XmlPullParser pp, final String attrName)
float Attr
return Double.parseDouble(attr(pp, attrName));
intintAttr(final XmlPullParser pp, final String attrName)
int Attr
return Integer.parseInt(attr(pp, attrName));