Java XML Element Child Append appendChildElement(Element parentNode, String nodeName)

Here you can find the source of appendChildElement(Element parentNode, String nodeName)

Description

append Child Element

License

Apache License

Declaration

public static Element appendChildElement(Element parentNode, String nodeName) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import org.w3c.dom.*;

public class Main {
    public static Element appendChildElement(Element parentNode, String nodeName) {
        Document doc = parentNode.getOwnerDocument();
        Element childNode = doc.createElement(nodeName);
        parentNode.appendChild(childNode);
        return childNode;
    }/*www. j av a  2 s.co m*/
}

Related

  1. appendChild(Document doc, Element parentElement, String elementName, String elementValue)
  2. appendChild(Document doc, Node parentNode, String childName, String childContents)
  3. appendChild(Document document, Node root, String name, String value)
  4. appendChildElement(Document doc, Element parent, Element child)
  5. appendChildElement(Element parent, Element el, String[] order)
  6. appendChildElement(final Element parentElement, final String name, final String value)
  7. appendChildElementBoolean(Element parentNode, String tagName, boolean content)
  8. appendChildElmt(Element aElmt, String aChildName)
  9. appendNewComment(Element parentElement, String commentText)