List of utility methods to do XML Child Element Add
Element | addChildElement(Element parentElement, String elementName) add Child Element Element childElement = parentElement.getOwnerDocument().createElement(elementName);
parentElement.appendChild(childElement);
return childElement;
|
Element | addChildElement(Element parentElement, String elementName) add Child Element Element childElement = parentElement.getOwnerDocument().createElement(elementName);
parentElement.appendChild(childElement);
return childElement;
|
Element | addChildElement(Element root, Element element, String name) add Child Element String safeName = name.replaceAll("\\$", "::"); Element child = getNewElement(root, safeName); element.appendChild(child); return child; |
Element | addChildElement(Node element, String name, String[][] attributes) add Child Element return addChildElement(element, name, null, attributes);
|
Element | addChildElement(Node parent, String elementName, String textContent) add Child Element Element element = addChildElement(parent, elementName);
element.setTextContent(textContent);
return element;
|
Element | addChildElement(Node parent, String tag, String value) Adds a Child element to the parent node. Document doc = (parent.getNodeType() == Node.DOCUMENT_NODE) ? (Document) parent : parent.getOwnerDocument(); Element child = doc.createElement(tag); if (value != null) child.appendChild(doc.createTextNode(value)); parent.appendChild(child); return child; |
void | addChildElements(Node n, List add Child Elements NodeList nl = n.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { n = nl.item(i); if (n.getNodeType() != 1) { continue; } else { if (hasChild(n)) { addChildElements(n, elements); ... |
Node | addChildNode(Node pNode, String name, String value) add Child Node Document _doc = null; if (pNode.getNodeType() == Node.DOCUMENT_NODE) { _doc = (Document) pNode; } else { _doc = pNode.getOwnerDocument(); Element _ele = _doc.createElement(name); Node _node = _doc.createTextNode(value); ... |
void | addChildren(Element element, List children) Append the given list of children Elements to the given Element. for (int i = 0; i < children.size(); i++) { element.appendChild((Element) children.get(i)); |
void | addElement(Element parent, Element child) Add the child node to parent parent.appendChild(child); |