Here you can find the source of addElement(final Document document, final Element parentDom, final String namespace, final String name)
Parameter | Description |
---|---|
document | root document |
parentDom | parent node |
namespace | namespace |
name | element name |
public static Element addElement(final Document document, final Element parentDom, final String namespace, final String name)
//package com.java2s; //License from project: LGPL import org.w3c.dom.Document; import org.w3c.dom.Element; public class Main { /**//from www .j a va 2 s . co m * This method creates and adds a new XML {@code Element} * * @param document * root document * @param parentDom * parent node * @param namespace * namespace * @param name * element name * @return added element */ public static Element addElement(final Document document, final Element parentDom, final String namespace, final String name) { final Element dom = document.createElementNS(namespace, name); parentDom.appendChild(dom); return dom; } }