Here you can find the source of parseDocumentr(File f)
public static Document parseDocumentr(File f) throws SAXException, IOException, ParserConfigurationException
//package com.java2s; //License from project: LGPL import java.io.File; import java.io.IOException; import java.io.InputStream; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; import org.w3c.dom.Document; import org.xml.sax.InputSource; import org.xml.sax.SAXException; public class Main { private static DocumentBuilderFactory documentBuilderFactory; private static DocumentBuilder documentBuilder; public static Document parseDocumentr(File f) throws SAXException, IOException, ParserConfigurationException { return getDocumentBuilder().parse(f); }//ww w. ja v a 2 s. c o m public static Document parseDocumentr(InputSource is) throws SAXException, IOException, ParserConfigurationException { return getDocumentBuilder().parse(is); } public static Document parseDocumentr(InputStream is) throws SAXException, IOException, ParserConfigurationException { return getDocumentBuilder().parse(is); } public static Document parseDocumentr(String uri) throws SAXException, IOException, ParserConfigurationException { return getDocumentBuilder().parse(uri); } public static Document parseDocumentr(InputStream is, String systemId) throws SAXException, IOException, ParserConfigurationException { return getDocumentBuilder().parse(is, systemId); } public static DocumentBuilder getDocumentBuilder() throws ParserConfigurationException { if (documentBuilder == null) { documentBuilder = newDocumentBuilder(); } return documentBuilder; } public static DocumentBuilder newDocumentBuilder() throws ParserConfigurationException { return getDocumentBuilderFactory().newDocumentBuilder(); } public static DocumentBuilderFactory getDocumentBuilderFactory() { if (documentBuilderFactory == null) { documentBuilderFactory = DocumentBuilderFactory.newInstance(); } return documentBuilderFactory; } }