List of usage examples for org.w3c.dom CDATASection getLength
public int getLength();
data
and the substringData
method below. From source file:Main.java
public static void main(String[] argv) throws Exception { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); InputSource is = new InputSource(); is.setCharacterStream(new StringReader(xmlRecords)); Document doc = factory.newDocumentBuilder().parse(is); CDATASection cdataNode = doc.createCDATASection(""); CharacterData cdata = cdataNode; cdata.appendData("from java2s.com"); System.out.println(cdataNode.getLength()); }
From source file:TreeDumper2.java
private void dumpCDATASectionNode(CDATASection node, String indent) { System.out.println(indent + "CDATA SECTION length=" + node.getLength()); System.out.println(indent + "\"" + node.getData() + "\""); }