Java XML CData getCharacterDataFromElement(Element e)

Here you can find the source of getCharacterDataFromElement(Element e)

Description

get Character Data From Element

License

Open Source License

Declaration

public static String getCharacterDataFromElement(Element e) 

Method Source Code

//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 "?";
        }
    }
}

Related

  1. createNewCDATAElement(Node elem, String tag, String value)
  2. getCharacterData(Element el)
  3. getCharacterDataFromElement(Element e)
  4. getCharacterDataFromElement(Element e)
  5. getCharacterDataFromElementWithKey(final Element element, final String key)
  6. isCDataOrText(int nodeType)
  7. parseCdataSection(Node cdataParentNode)