Here you can find the source of parseFloat(Node xmlAttribute, float invalidValue)
public static float parseFloat(Node xmlAttribute, float invalidValue)
//package com.java2s; //License from project: Apache License import org.w3c.dom.*; public class Main { public static float parseFloat(Node xmlAttribute, float invalidValue) { if (xmlAttribute == null) return invalidValue; return parseFloat(xmlAttribute.getNodeValue(), invalidValue); }//w w w. j av a 2 s . c o m public static float parseFloat(String xmlAttributeValue, float invalidValue) { if (xmlAttributeValue == null) return invalidValue; try { return Double.valueOf(xmlAttributeValue).floatValue(); } catch (NumberFormatException ex) { return invalidValue; } } }