List of utility methods to do XML Child Insert
void | insertAfter(Node newChild, Node refChild) __UNDOCUMENTED__ if (refChild == null) { throw new DOMException(DOMException.NOT_FOUND_ERR, "refChild == null"); Node nextSibling = refChild.getNextSibling(); if (nextSibling == null) { refChild.getParentNode().appendChild(newChild); } else { refChild.getParentNode().insertBefore(newChild, nextSibling); ... |
Node | insertAfter(Node parent, Node newChild, Node refChild) Inserts the node newChild after the existing child node refChild. if (refChild != null) { Node next = refChild.getNextSibling(); return parent.insertBefore(newChild, next); return parent.insertBefore(newChild, refChild); |
void | prependChild(Element parent, Element child) adds a child at the first place Node first = parent.getFirstChild(); if (first == null) parent.appendChild(child); else { parent.insertBefore(child, first); |
Element | prependChildElement(Element parent, Element child) prepend a child element Node firstChild = parent.getFirstChild(); if (firstChild == null) { return (Element) parent.appendChild(child); } else { return (Element) parent.insertBefore(child, firstChild); |
Element | prependChildElement(Element parent, Element child) prepend a child element Node firstChild = parent.getFirstChild(); if (firstChild == null) { return (Element) parent.appendChild(child); } else { return (Element) parent.insertBefore(child, firstChild); |