Java tutorial
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static Double get_double(Element element, String name) { Double d = null; NodeList list = element.getElementsByTagName(name); if (list.getLength() > 0) { try { d = Double.valueOf(list.item(0).getTextContent()); } catch (NumberFormatException e) { System.err.println(e); return null; } } else { System.err.println("No \"" + name + "\" defined"); return null; } return d; } }