Here you can find the source of getDoubleAttribute(String name, Element el)
public static Double getDoubleAttribute(String name, Element el)
//package com.java2s; import org.w3c.dom.*; public class Main { /**/* w w w .ja va2 s . c om*/ * Gets the value of the DOM element's attribute with the given name * as a Double, or null if the value is not a double. */ public static Double getDoubleAttribute(String name, Element el) { return stringToDouble(getAttribute(name, el)); } private static Double stringToDouble(String value) { if (value == null) return null; try { return new Double(value); } catch (NumberFormatException exc) { return null; } } /** * Gets the value of the given DOM element's attribute * with the specified name. */ public static String getAttribute(String name, Element el) { if (name == null || el == null) return null; if (!el.hasAttribute(name)) return null; return el.getAttribute(name); } }