Java tutorial
//package com.java2s; import org.w3c.dom.NamedNodeMap; public class Main { public static float getFloatAttr(NamedNodeMap attributes, String attrName) { return Float.parseFloat(getAttr(attributes, attrName)); } public static String getAttr(NamedNodeMap attributes, String attrName) { return attributes.getNamedItem(attrName).getNodeValue(); } }