Java Utililty Methods XML Duration Add

List of utility methods to do XML Duration Add

Description

The list of methods to do XML Duration Add are organized into topic(s).

Method

ElementappendElement(Node parent, String name)
append Element
return appendElement(parent, name, null);
ElementappendElement(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)));
ElementappendElementNS(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;
voidappendStringElement(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);
voidappendText(Element parent, String content)
Adds nested text.
Document doc = parent.getOwnerDocument();
Text t = doc.createTextNode(content);
parent.appendChild(t);
ElementappendTextElement(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));
voidappendTextElement(Element parent, String name, String content)
Adds nested text in a new child element.
Element e = createChildElement(parent, name);
appendText(e, content);
NodeappendTextNode(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;