Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.io.InputStream;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;

import org.w3c.dom.Document;
import org.xml.sax.InputSource;

public class Main {
    private static Document buildDocument(InputStream in) throws Exception {
        DocumentBuilderFactory factory = null;
        DocumentBuilder builder = null;
        Document ret = null;

        factory = DocumentBuilderFactory.newInstance();
        builder = factory.newDocumentBuilder();

        ret = builder.parse(new InputSource(in));
        return ret;
    }
}