Here you can find the source of getAttributeByName(XmlPullParser xpp, String name)
Parameter | Description |
---|---|
xpp | a parameter |
name | a parameter |
public static String getAttributeByName(XmlPullParser xpp, String name)
//package com.java2s; import org.xmlpull.v1.XmlPullParser; public class Main { /**// w w w . j a v a2 s .c o m * Returns the XML attribute by name, not as fast as using attribute indexes * but much more durable in case of future api changes * * @param xpp * @param name * @return */ public static String getAttributeByName(XmlPullParser xpp, String name) { for (int i = 0; i < xpp.getAttributeCount(); i++) if (name.equalsIgnoreCase(xpp.getAttributeName(i))) return xpp.getAttributeValue(i); return null; } }