Here you can find the source of getCharacterDataFromElementWithKey(final Element element, final String key)
public static String getCharacterDataFromElementWithKey(final Element element, final String key)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.CharacterData; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; public class Main { public static String getCharacterDataFromElementWithKey(final Element element, final String key) { String result = null;/*from www . j a va2 s . c o m*/ if (element != null) { final NodeList jobNodeList = element.getElementsByTagName(key); final Node node = jobNodeList.item(0); if (node != null) { final CharacterData characterData = (CharacterData) jobNodeList.item(0).getChildNodes().item(0); if (characterData != null) { result = characterData.getNodeValue(); } } } return result; } }