Java XML Element Create createElementNS(Document root, String namespaceURI, String qualifiedName)

Here you can find the source of createElementNS(Document root, String namespaceURI, String qualifiedName)

Description

create Element NS

License

Apache License

Declaration

public static Element createElementNS(Document root, String namespaceURI, String qualifiedName) 

Method Source Code

//package com.java2s;
/**//from ww  w .  j av a  2 s  . c  o m
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import javax.xml.namespace.QName;

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

import org.w3c.dom.Node;

public class Main {
    public static Element createElementNS(Node node, QName name) {
        return createElementNS(node.getOwnerDocument(), name.getNamespaceURI(), name.getLocalPart());
    }

    public static Element createElementNS(Document root, QName name) {
        return createElementNS(root, name.getNamespaceURI(), name.getLocalPart());
    }

    public static Element createElementNS(Document root, String namespaceURI, String qualifiedName) {
        return root.createElementNS(namespaceURI, qualifiedName);
    }
}

Related

  1. createElementInTempDocument(String name, String prefix, String namespaceURI)
  2. createElementLn(Document d, String name, String value, boolean isCDATA)
  3. createElementMapping(final Document doc1, final Document doc2)
  4. createElementMappingForNodes(final Node n1, final Node n2, final Map mapping)
  5. createElementNS(Document doc, String namespaceURI, String prefix, String nodeName)
  6. createElementNS(String namespaceURI, String qualifiedName, String text, Document doc)
  7. createElementNsIn(Element parent, String ns, String name, String textContent)
  8. createElementWithText(Element parent, String name, String value)
  9. createElmWithText(Document doc, String tagName, String text)