Create xml Document Builder - Java XML

Java examples for XML:DOM Document

Description

Create xml Document Builder

Demo Code


//package com.java2s;

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

public class Main {
    public static void main(String[] argv) throws Exception {
        System.out.println(xmlBuilder());
    }/*from w ww . j a  va 2s .  co  m*/

    private static DocumentBuilder xmlBuilder()
            throws ParserConfigurationException {
        DocumentBuilderFactory factory = DocumentBuilderFactory
                .newInstance();
        return factory.newDocumentBuilder();
    }
}

Related Tutorials