Java tutorial
//package com.java2s; /* * For license please see accompanying LICENSE.txt file (available also at http://www.xmlpull.org/). * According to www.xmlpull.org, this code is in the public domain. */ import org.xmlpull.v1.XmlPullParser; public class Main { public static float floatAttr(final XmlPullParser pp, final String attrName) { return Float.parseFloat(pp.getAttributeValue(null, attrName).trim()); } /** * Return value of attribute with given name and no namespace. */ public static String getAttributeValue(final XmlPullParser pp, final String name) { return pp.getAttributeValue(XmlPullParser.NO_NAMESPACE, name); } }