You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Kevin Regan <ke...@valicert.com> on 2000/07/06 03:12:16 UTC

ignorable white space and javax.xml.parsers.*

It seems that the DocumentBuilder returned by the Sun JAXP 1.0.1
distribution will not include ignorable white space in the final DOM
when invoked with the following code:

	DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
	factory.setValidating( true );
	factory.setNamespaceAware( false );

	DocumentBuilder builder = factory.newDocumentBuilder();
	Document document = builder.parse( uri );

However, when using the DocumentBuilderFactory provided by
Xerces, the underlying DOMParser that is actually created
includes ignorable white space.  There does not seem to be
a way to change this programmatically.

Would it make more sense to have the DocumentBuilderImpl call
DOMParser.setIncludeIgnorableWhitespace( false ) in order to
match the behavior of the Sun JAXP 1.0.1 distribution?

Sincerely,
Kevin Regan
kevinr@valicert.com