Here you can find the source of getElementAsFloat(Element e, String name, Float dft)
public static Float getElementAsFloat(Element e, String name, Float dft)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; public class Main { public static Float getElementAsFloat(Element e, String name, Float dft) { String num = getElement(e, name); return num.equals("") ? dft : Float.parseFloat(num); }/*from w w w . j av a 2 s . c om*/ public static String getElement(Element e, String name) { if (e.getElementsByTagName(name) == null) return ""; if (e.getElementsByTagName(name).item(0) == null) return ""; return e.getElementsByTagName(name).item(0).getTextContent(); } }