Java tutorial
//package com.java2s; /*-------------------------------------------------------------------------- * Copyright (c) 2004, 2006 OpenMethods, LLC * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * Trip Gilman (OpenMethods), Lonnie G. Pryor (OpenMethods), * Vincent Pruitt (OpenMethods) * * T.D. Barnes (OpenMethods) - initial API and implementation -------------------------------------------------------------------------*/ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; public class Main { /** * Convenience function to get a DOM document builder object. * * @return A new <code>DocumentBuilder</code> instance. * @throws ParserConfigurationException */ public static DocumentBuilder getDocumentBuilder() throws ParserConfigurationException { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance(); return documentBuilderFactory.newDocumentBuilder(); } }