Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import org.w3c.dom.Document;

import org.xml.sax.SAXException;
import javax.xml.parsers.*;
import java.io.IOException;
import java.io.InputStream;

public class Main {

    public static Document buildXmlDocument(InputStream stream)
            throws ParserConfigurationException, SAXException, IOException {
        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        return db.parse(stream);
    }
}