Here you can find the source of getFloatAttribute(String name, Element el)
public static Float getFloatAttribute(String name, Element el)
//package com.java2s; import org.w3c.dom.*; public class Main { /**//from w w w .jav a2 s .com * Gets the value of the DOM element's attribute with the given name * as a Float, or null if the value is not a float. */ public static Float getFloatAttribute(String name, Element el) { return stringToFloat(getAttribute(name, el)); } private static Float stringToFloat(String value) { if (value == null) return null; try { return new Float(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); } }