Java XML Child Element Add addChildElement(Element parentElement, String elementName)

Here you can find the source of addChildElement(Element parentElement, String elementName)

Description

add Child Element

License

Open Source License

Declaration

static public Element addChildElement(Element parentElement,
            String elementName) 

Method Source Code

//package com.java2s;
//License from project: GNU General Public License 

import org.w3c.dom.Element;

public class Main {
    static public Element addChildElement(Element parentElement,
            String elementName) {
        Element childElement = parentElement.getOwnerDocument()
                .createElement(elementName);
        parentElement.appendChild(childElement);
        return childElement;
    }//from   w w  w .j  a v a  2 s  . co  m
}

Related

  1. addChild(Node parent, String namespaceURI, String childName)
  2. addChildElement(Element element, String name, Object textValue)
  3. addChildElement(Element element, String name, String text)
  4. addChildElement(Element element, String name, String text)
  5. addChildElement(Element element, String name, String text)
  6. addChildElement(Element parentElement, String elementName)
  7. addChildElement(Element root, Element element, String name)
  8. addChildElement(Node element, String name, String[][] attributes)
  9. addChildElement(Node parent, String elementName, String textContent)