Java XML Element Create createElementNsIn(Element parent, String ns, String name, String textContent)

Here you can find the source of createElementNsIn(Element parent, String ns, String name, String textContent)

Description

create Element Ns In

License

Apache License

Declaration

public static Element createElementNsIn(Element parent, String ns, String name, String textContent) 

Method Source Code

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

import org.w3c.dom.Element;

public class Main {
    public static Element createElementNsIn(Element parent, String ns, String name, String textContent) {
        Element el = parent.getOwnerDocument().createElementNS(ns, name);
        parent.appendChild(el);/*from ww w. j  av a 2 s .  co m*/
        el.setTextContent(textContent);
        return el;
    }

    public static Element createElementNsIn(Element parent, String ns, String name) {
        Element el = parent.getOwnerDocument().createElementNS(ns, name);
        parent.appendChild(el);
        return el;
    }
}

Related

  1. createElementMapping(final Document doc1, final Document doc2)
  2. createElementMappingForNodes(final Node n1, final Node n2, final Map mapping)
  3. createElementNS(Document doc, String namespaceURI, String prefix, String nodeName)
  4. createElementNS(Document root, String namespaceURI, String qualifiedName)
  5. createElementNS(String namespaceURI, String qualifiedName, String text, Document doc)
  6. createElementWithText(Element parent, String name, String value)
  7. createElmWithText(Document doc, String tagName, String text)
  8. createNewElementAndSetAndAttribute(Document document, Element parent, String childElement, String childValue, String attributeName, String attributeValue)
  9. createNode(Document doc, Element parent, String nodeName, Object[] attr)