Here you can find the source of getCharacterDataFromElement(Element e)
public static String getCharacterDataFromElement(Element e)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.CharacterData; import org.w3c.dom.Element; import org.w3c.dom.Node; public class Main { public static String getCharacterDataFromElement(Element e) { Node child = e.getFirstChild(); if (child instanceof CharacterData) { CharacterData cd = (CharacterData) child; return cd.getData(); } else {//from w w w . j a v a 2s .c o m return "?"; } } }