Java XML Document from File loadDocument(String filePath)

Here you can find the source of loadDocument(String filePath)

Description

load Document

License

Apache License

Declaration

public static Document loadDocument(String filePath) throws Exception 

Method Source Code


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

import org.w3c.dom.Document;

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

public class Main {
    public static Document loadDocument(String filePath) throws Exception {
        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        Document doc = builder.parse(filePath);
        return doc;
    }// w  ww . ja v  a 2  s .c  o m
}

Related

  1. isXMLFile(File file)
  2. load(String file)
  3. load(String sFileName)
  4. loadDocument(File documentFile)
  5. loadDocument(File file)
  6. loadRootElement(DocumentBuilder documentBuilder, File file)
  7. loadXML(String filename)
  8. loadXml(String fileName)
  9. loadXml(String filePath)