Here you can find the source of createDocumentBuilder(boolean namespaces, boolean validating)
private static DocumentBuilder createDocumentBuilder(boolean namespaces, boolean validating) throws ParserConfigurationException
//package com.java2s; /*// w w w .j a va 2 s .c om * Copyright (c) 2012. betterFORM Project - http://www.betterform.de * Licensed under the terms of BSD License */ import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; public class Main { private static DocumentBuilder createDocumentBuilder(boolean namespaces, boolean validating) throws ParserConfigurationException { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(namespaces); factory.setValidating(validating); // factory.setAttribute("http://xml.org/sax/features/namespace-prefixes)",new Boolean(true)); DocumentBuilder builder = factory.newDocumentBuilder(); return builder; } }