Java tutorial
//package com.java2s; // modify it under the terms of the GNU General Public License import org.w3c.dom.Element; public class Main { public static double getXMLNum(Element e, String attrName) { try { return Double.parseDouble(e.getAttribute(attrName)); } catch (Exception exc) { return 0; } } }