@Test public void mergeSingleCDATASection() { Element e = doc.createElement(FOO); CDATASection t = doc.createCDATASection(BAR); e.appendChild(t); assertEquals(BAR, Nodes.getMergedNestedText(e)); }
public static String getMergedNestedText(Node n) { StringBuilder sb = new StringBuilder(); for (Node child : new IterableNodeList(n.getChildNodes())) { if (child instanceof Text) { String s = child.getNodeValue(); if (s != null) { sb.append(s); } } } return sb.toString(); }
Nodes { public static String getMergedNestedText(Node n) { StringBuilder sb = new StringBuilder(); for (Node child : new IterableNodeList(n.getChildNodes())) { if (child instanceof Text) { String s = child.getNodeValue(); if (s != null) { sb.append(s); } } } return sb.toString(); } }
Nodes { public static String getMergedNestedText(Node n) { StringBuilder sb = new StringBuilder(); for (Node child : new IterableNodeList(n.getChildNodes())) { if (child instanceof Text) { String s = child.getNodeValue(); if (s != null) { sb.append(s); } } } return sb.toString(); } private  Nodes(); }
Nodes { public static String getMergedNestedText(Node n) { StringBuilder sb = new StringBuilder(); for (Node child : new IterableNodeList(n.getChildNodes())) { if (child instanceof Text) { String s = child.getNodeValue(); if (s != null) { sb.append(s); } } } return sb.toString(); } private  Nodes(); static QName getQName(Node n); static String getMergedNestedText(Node n); static Map<QName, String> getAttributes(Node n); static Node stripWhitespace(Node original); static Node normalizeWhitespace(Node original); static Node stripElementContentWhitespace(Node original); }
Nodes { public static String getMergedNestedText(Node n) { StringBuilder sb = new StringBuilder(); for (Node child : new IterableNodeList(n.getChildNodes())) { if (child instanceof Text) { String s = child.getNodeValue(); if (s != null) { sb.append(s); } } } return sb.toString(); } private  Nodes(); static QName getQName(Node n); static String getMergedNestedText(Node n); static Map<QName, String> getAttributes(Node n); static Node stripWhitespace(Node original); static Node normalizeWhitespace(Node original); static Node stripElementContentWhitespace(Node original);  }