Here you can find the source of getElementValue(Node aElem)
Parameter | Description |
---|---|
aElem | Element |
public static final String getElementValue(Node aElem)
//package com.java2s; import org.w3c.dom.Node; public class Main { /**//from ww w . j av a 2 s .co m * Gets item value * * @param aElem * Element * @return Value */ public static final String getElementValue(Node aElem) { Node child; if (aElem != null) { if (aElem.hasChildNodes()) { for (child = aElem.getFirstChild(); child != null; child = child .getNextSibling()) { if (child.getNodeType() == Node.TEXT_NODE) { return child.getNodeValue(); } } } } return ""; } }