List of utility methods to do XML Duration Add
Element | appendElement(Node parent, String name) append Element return appendElement(parent, name, null);
|
Element | appendElement(Node parent, String tagName) Appends a child element with the given tag name to the specified parent node. return ((Element) parent
.appendChild((parent.getOwnerDocument() != null ? parent.getOwnerDocument() : (Document) parent)
.createElement(tagName)));
|
Element | appendElementNS(Element parent, String namespaceURI, String localName) Appends a new empty child element with the given namespace and name. Element ret = parent.getOwnerDocument().createElementNS(namespaceURI, localName);
parent.appendChild(ret);
return ret;
|
void | appendStringElement(Element parentElement, String nodeName, String nodeValue) append String Element Element elem = selectSingleElement(parentElement, nodeName);
if (elem == null) {
elem = parentElement.getOwnerDocument().createElement(nodeName);
parentElement.appendChild(elem);
elem.setTextContent(nodeValue);
|
void | appendText(Element parent, String content) Adds nested text. Document doc = parent.getOwnerDocument(); Text t = doc.createTextNode(content); parent.appendChild(t); |
Element | appendTextElement(Element parent, String element, long value) Creates a subelement with a single child, a text node, as a child of an existing node. return appendTextElement(parent, element, Long.toString(value));
|
void | appendTextElement(Element parent, String name, String content) Adds nested text in a new child element. Element e = createChildElement(parent, name); appendText(e, content); |
Node | appendTextNode(Element parentElement, String initialTextContent) append Text Node Node newChildElement = null; if (parentElement != null) { Document ownerDocument = parentElement.getOwnerDocument(); newChildElement = ownerDocument.createTextNode(initialTextContent); parentElement.appendChild(newChildElement); return newChildElement; |