Here you can find the source of newDocument(boolean isNamespaceAware, boolean isValidating)
Parameter | Description |
---|---|
isNamespaceAware | __UNDOCUMENTED__ |
isValidating | __UNDOCUMENTED__ |
public static Document newDocument(boolean isNamespaceAware, boolean isValidating)
//package com.java2s; /*//from w w w . j a v a 2 s . com * Copyright (c) 2012. betterFORM Project - http://www.betterform.de * Licensed under the terms of BSD License */ import org.w3c.dom.*; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; public class Main { /** * __UNDOCUMENTED__ * * @param isNamespaceAware __UNDOCUMENTED__ * @param isValidating __UNDOCUMENTED__ * @return __UNDOCUMENTED__ */ public static Document newDocument(boolean isNamespaceAware, boolean isValidating) { // !!! workaround to enable betterForm to run within WebLogic Server // Force JAXP to use xerces as the default JAXP parser doesn't work with BetterForm // // String oldFactory = System.getProperty("javax.xml.parsers.DocumentBuilderFactory"); // System.setProperty("javax.xml.parsers.DocumentBuilderFactory","org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"); DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); // restore to original factory // // System.setProperty("javax.xml.parsers.DocumentBuilderFactory",oldFactory); // !!! end workaround factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(isNamespaceAware); factory.setValidating(isValidating); try { // Create builder. DocumentBuilder builder = factory.newDocumentBuilder(); return builder.newDocument(); } catch (ParserConfigurationException pce) { System.err.println(pce.toString()); } return null; } }