Here you can find the source of getDocumentBuilder(boolean NamespaceAwareness)
private static DocumentBuilder getDocumentBuilder(boolean NamespaceAwareness) throws ParserConfigurationException
//package com.java2s; //License from project: Apache License import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; public class Main { private static DocumentBuilder getDocumentBuilder(boolean NamespaceAwareness) throws ParserConfigurationException { DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance(); domFactory.setNamespaceAware(NamespaceAwareness); //domFactory.setValidating(true); //domFactory.setIgnoringElementContentWhitespace( true ); domFactory.setAttribute("http://apache.org/xml/features/dom/include-ignorable-whitespace", Boolean.FALSE); return domFactory.newDocumentBuilder(); }// w ww .ja v a2 s.c o m }