Java Utililty Methods XML Child Element Add

List of utility methods to do XML Child Element Add

Description

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

Method

ElementaddElement(Element parent, Element childElement)
add Element
Node childNode = parent.getOwnerDocument().importNode(childElement, true);
parent.appendChild(childNode);
return parent;
ElementaddElementChildTo(Element parent, String nsURI, String qualifiedName)
Adds an Element child to the given element.
final Document doc = parent.getOwnerDocument();
final Element child = doc.createElementNS(nsURI, qualifiedName);
parent.appendChild(child);
return child;
voidappendElement(Element parent, Element child)
Appends another element as a child element.
Node tmp = parent.getOwnerDocument().importNode(child, true);
parent.appendChild(tmp);
voidappendElement(Element parent, Element child)
append Element
Node tmp = parent.getOwnerDocument().importNode(child, true);
parent.appendChild(tmp);
NodeappendTextNode(Node parent, String child)
append Text Node
if (parent == null)
    System.err.println("parent null 0");
if (parent instanceof Document)
    parent = ((Document) parent).getDocumentElement();
if (parent == null)
    System.err.println("parent null 1");
if (parent.getOwnerDocument() == null)
    System.err.println("parent ownerdoc null");
...