List of utility methods to do XML CDATA Append
void | appendCDATA(Element parent, String content) Adds a nested CDATA section. Document doc = parent.getOwnerDocument(); CDATASection c = doc.createCDATASection(content); parent.appendChild(c); |
void | appendCDATAElement(Element parent, String name, String content) Adds a nested CDATA section in a new child element. Element e = createChildElement(parent, name); appendCDATA(e, content); |
Element | appendCDATAElement(Element parent, String tagName, String value) append CDATA Element Element child = appendElement(parent, tagName); if (value == null) { value = ""; Node cdata = child.getOwnerDocument().createCDATASection(value); child.appendChild(cdata); return child; |
Element | appendCDATAElement(Element parent, String tagName, String value) Appends the CDATA element to the parent element. Element child = appendElement(parent, tagName); if (value == null) { value = ""; Node cdata = child.getOwnerDocument().createCDATASection(value); child.appendChild(cdata); return child; |
void | appendCDATASection(CDATASection cdataSection, StringBuffer buf) append CDATA Section buf.append("<![CDATA["); buf.append(cdataSection.getData()); buf.append("]]>"); |
void | appendCDATASection(Node parent, String name, Object data) append CDATA Section Document doc = (parent.getNodeType() == Node.DOCUMENT_NODE) ? (Document) parent : parent.getOwnerDocument(); Element e = doc.createElement(name); parent.appendChild(e); e.appendChild(doc.createCDATASection(data.toString())); |
void | appendCDATASubNode(String elementName, String nodeData, Element parentElement, Document doc) Creates a cdata node within a created element and then attaches the date to a parent. Element subElement = doc.createElement(elementName); subElement.appendChild(doc.createCDATASection(nodeData)); parentElement.appendChild(subElement); |
void | setCDATA(Element element, String data) set CDATA if (data == null) data = ""; element.appendChild(element.getOwnerDocument().createCDATASection(data)); |
void | setCData(Element element, String data) Sets data to be the CDATA content of element if (data == null) return; CDATASection txt = getCDataNode(element); if (txt != null) txt.setData(data); else { txt = element.getOwnerDocument().createCDATASection(data); element.appendChild(txt); ... |