Here you can find the source of getAttribAsFloat(Element e, String name, Float dft)
public static Float getAttribAsFloat(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 getAttribAsFloat(Element e, String name, Float dft) { String num = getAttribute(e, name); return num.equals("") ? dft : Float.parseFloat(num); }//from ww w . ja va 2s .co m public static String getAttribute(Element e, String name) { if (e.getAttribute(name) == null) return ""; return e.getAttribute(name); } }