Java XML Element Root createRoot(Document document, String title)

Here you can find the source of createRoot(Document document, String title)

Description

create Root

License

Open Source License

Declaration

public static Element createRoot(Document document, String title) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

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

public class Main {
    public static Element createRoot(Document document, String title) {
        Element node = document.createElement(title);
        node.setAttribute("xmlns", "http://www.supermap.com.cn/desktop");
        node.setAttribute("version", "9.0.x");
        document.appendChild(node);//from  www  .  j  a  va 2 s.co  m
        return node;
    }
}

Related

  1. createRootElement(Document doc, String name)
  2. createRootElement(Document doc, String name)
  3. createRootElement(Document doc, String rootTagName)
  4. getElement(String elementName, Node rootNode)