Here you can find the source of getElementFloatValue(Document document, Element parent, String element)
public static float getElementFloatValue(Document document, Element parent, String element)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static float getElementFloatValue(Document document, Element parent, String element) { return Float.parseFloat(getElementStringValue(document, parent, element)); }// ww w . j a v a 2s . c om public static String getElementStringValue(Document document, Element parent, String element) { NodeList nl = parent.getElementsByTagName(element); if (nl.getLength() == 0) { return ""; } Node n = nl.item(0).getFirstChild(); if (n == null) { return ""; } return n.getNodeValue(); } }