Here you can find the source of readDoubleAttr(Element element, String attributeName, double defaultValue)
public static double readDoubleAttr(Element element, String attributeName, double defaultValue)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; public class Main { public static double readDoubleAttr(Element element, String attributeName, double defaultValue) { String attributeValue = element.getAttribute(attributeName); try {/*from w ww . j a v a2 s.co m*/ return Double.parseDouble(attributeValue); } catch (NumberFormatException e) { return defaultValue; } } }