Java XML Child Element Create addElement(Document doc, String name, Element parent)

Here you can find the source of addElement(Document doc, String name, Element parent)

Description

add Element

License

Open Source License

Declaration

public static Element addElement(Document doc, String name, Element parent) 

Method Source Code

//package com.java2s;
/* Copyright 2004 - 2007 Kasper Nielsen <kasper@codehaus.org> Licensed under
 * the Apache 2.0 License, see http://coconut.codehaus.org/license.
 *//*from  ww  w  .  j a va  2  s .  c o  m*/

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class Main {
    public static Element addElement(Document doc, String name, Element parent) {
        Element ee = doc.createElement(name);
        parent.appendChild(ee);
        return ee;
    }
}

Related

  1. addChildNode(Document doc, Node parentNode, String childName, String childValue)
  2. addChildText(Document doc, Element parent, String textValue)
  3. addElement(Document doc, Element parent, String nodeName)
  4. addElement(Document doc, Element rootElement, String elementName, String typeIn, String isArrayIn, String partitionerIn)
  5. addElement(Document doc, Node parent, String element)
  6. addElement(Document document, Element father, String name, String attOneName, String attOneValue, String attTwoName, String attTwoValue)
  7. addElement(Document document, Element parentElement, String elementName, String elementValue)
  8. addElement(final Document doc, final Node parent, final String name)
  9. addElement(final Document document, final Element parentDom, final String namespace, final String name)