Document with whitspace
843834Oct 10 2002 — edited Oct 10 2002I am trying to use the JAXP 1.2 parser to create a Document with no whitespace Nodes, but when I do the following the document is filled with Whitespace Nodes. How can I get rid of them?
DocumentBuilderFactory domFactory
= DocumentBuilderFactory.newInstance();
domFactory.setNamespaceAware(true);
domFactory.setValidating(true);
domFactory.setAttribute(JAXP_SCHEMA_LANGUAGE, W3C_XML_SCHEMA);
domFactory.setAttribute(
"http://apache.org/xml/features/dom/include-ignorable-whitespace",
new Boolean(false));
domFactory.setIgnoringComments(true);
domFactory.setIgnoringElementContentWhitespace(true);
builder = domFactory.newDocumentBuilder();
Document doc = builder.parse(xml);