Java examples for XML:XML Element Value
get Tag Value from XML Element
//package com.java2s; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static String getTagValue(String sTag, Element eElement) { NodeList nlList = eElement.getElementsByTagName(sTag).item(0) .getChildNodes();/*from ww w.jav a2 s .c o m*/ Node nValue = (Node) nlList.item(0); return nValue.getNodeValue(); } }