Java XML Document from File readXML(File xml)

Here you can find the source of readXML(File xml)

Description

read XML

License

Open Source License

Declaration

private static Document readXML(File xml)
            throws ParserConfigurationException, SAXException, IOException 

Method Source Code

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

import org.w3c.dom.Document;

import org.xml.sax.SAXException;

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

import java.io.File;
import java.io.IOException;

public class Main {
    private static Document readXML(File xml)
            throws ParserConfigurationException, SAXException, IOException {
        DocumentBuilderFactory builderFactory = DocumentBuilderFactory
                .newInstance();/*from w  ww . j  a  v  a2s . c om*/
        builderFactory.setNamespaceAware(true);
        DocumentBuilder builder = builderFactory.newDocumentBuilder();
        return builder.parse(xml);
    }
}

Related

  1. readDocumentXML(File file)
  2. readXml(File file)
  3. readXML(File file)
  4. readXML(File file)
  5. readXML(File file)
  6. readXml(String path)
  7. readXML(String path)
  8. readXMLFile(File file)
  9. readXMLFile(String filename)