Java XML Document Create createDocument(String pageID)

Here you can find the source of createDocument(String pageID)

Description

create Document

License

Open Source License

Declaration

private static Document createDocument(String pageID) throws ParserConfigurationException 

Method Source Code

//package com.java2s;
/******************************************************************************
 * Copyright (c) 2000-2017 Ericsson Telecom AB
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 ******************************************************************************/

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;

import org.w3c.dom.DOMImplementation;
import org.w3c.dom.Document;

public class Main {
    private static Document createDocument(String pageID) throws ParserConfigurationException {
        final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        factory.setNamespaceAware(true);
        DocumentBuilder builder = factory.newDocumentBuilder();
        DOMImplementation implementation = builder.getDOMImplementation();
        // Create an xml document
        return implementation.createDocument(null, pageID, null);
    }/*from w w w. j av a2 s  .c  o m*/
}

Related

  1. createDocument(String docElt)
  2. createDocument(String docElt)
  3. createDocument(String iName)
  4. createDocument(String mainType, String customType)
  5. createDocument(String namespaceURI, String qualifiedName)
  6. createDocument(String root, NodeList content)
  7. createDocument(String rootElement)
  8. createDocument(String rootElementName)
  9. createDocument(String rootName)