get XML Document Builder - Java XML

Java examples for XML:DOM Document

Description

get XML Document Builder

Demo Code

/*****************************************************************************
 * Copyright (c) 2007 Jet Propulsion Laboratory,
 * California Institute of Technology.  All rights reserved
 *****************************************************************************/
//package com.java2s;

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

public class Main {
    public static DocumentBuilder getDocumentBuilder() {
        DocumentBuilder documentBuilder = null;

        try {/*from   w  w w.jav a 2  s .  c  o  m*/
            DocumentBuilderFactory documentBuilderfactory = DocumentBuilderFactory
                    .newInstance();
            documentBuilder = documentBuilderfactory.newDocumentBuilder();
        } catch (Exception exception) {
        }

        return documentBuilder;
    }
}

Related Tutorials