List of utility methods to do XmlPullParser Value Get
String | getAttributeByName(XmlPullParser xpp, String name) Returns the XML attribute by name, not as fast as using attribute indexes but much more durable in case of future api changes for (int i = 0; i < xpp.getAttributeCount(); i++) if (name.equalsIgnoreCase(xpp.getAttributeName(i))) return xpp.getAttributeValue(i); return null; |
String | getAttributeValue(XmlPullParser pp, String name) Return value of attribute with given name and no namespace. return pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, name);
|
String | getAttributeValue(XmlPullParser pp, String name) Return value of attribute with given name and no namespace. return pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, name);
|
Map | getAttributes( XmlPullParser pullParser) get Attributes Map<String, String> attributes = new HashMap<String, String>( pullParser.getAttributeCount()); for (int i = 0; i < pullParser.getAttributeCount(); i++) { attributes.put(pullParser.getAttributeName(i), pullParser.getAttributeValue(i)); return attributes; |
Map | getAttributes( XmlPullParser pullParser, String namespace, String elementName, String attributeName, String attributeValue) get Attributes Map<String, String> attributes = null; boolean shouldEndParse = false; if (pullParser != null) { if (!TextUtils.isEmpty(elementName)) { int event = pullParser.getEventType(); while (event != XmlPullParser.END_DOCUMENT && !shouldEndParse) { switch (event) { ... |
String | getPIData(XmlPullParser pp) Return everything past PITarget and S from Processing Instruction (PI) as defined in XML 1.0 Section 2.6 Processing Instructions [16] PI ::= '<?'
|
String | getPIData(XmlPullParser pp) Return everything past PITarget and S from Processing Instruction (PI) as defined in XML 1.0 Section 2.6 Processing Instructions [16] PI ::= '<?'
|
String | getPITarget(XmlPullParser pp) Return PITarget from Processing Instruction (PI) as defined in XML 1.0 Section 2.6 Processing Instructions [16] PI ::= '<?'
|
String | getPITarget(XmlPullParser pp) Return PITarget from Processing Instruction (PI) as defined in XML 1.0 Section 2.6 Processing Instructions [16] PI ::= '<?'
|
String | getRequiredAttributeValue(XmlPullParser pp, String namespace, String name) Read attribute value and return it or throw exception if current element does not have such attribute. String value = pp.getAttributeValue(namespace, name); if (value == null) { throw new XmlPullParserException("required attribute " + name + " is not present"); } else { return value; |