Here you can find the source of getDocumentBuilder()
DocumentBuilder
, which is used for parsing XML documents.
DocumentBuilder
which is used for parsing XML documents. Never null
.
public static DocumentBuilder getDocumentBuilder()
//package com.java2s; //License from project: Artistic License import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; public class Main { /**/*from w w w.ja v a 2 s. com*/ * Returns a <code>DocumentBuilder</code>, which is used for parsing XML * documents. * * @return a <code>DocumentBuilder</code> which is used for parsing XML * documents. Never <code>null</code>. */ public static DocumentBuilder getDocumentBuilder() { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setNamespaceAware(true); dbf.setValidating(false); return dbf.newDocumentBuilder(); } catch (ParserConfigurationException e) { e.printStackTrace(); throw new RuntimeException(e.getMessage()); } } }