[jdom-interest] Is DOMBuilder buggy ?

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu May 10 06:55:59 PDT 2001


At 10:27 AM -0700 5/9/01, Jason Hunter wrote:
>The DOMBuilder version in CVS doesn't have any serious known issues.  If
>you believe you've found a bug, test against what's in CVS and if it's
>still there pls send in a reproducible use case so we can identify and
>fix it.
>

I recently noticed that DOMBuilder is throwing away ignorable white 
space. I'll see if I can produce a simple test case. Unlike the 
similar problem with SAXBuilder, it was not immediately obvious to me 
why this was so, much less how to fix it though.

There is an Apache property that determines this behavior:

http://apache.org/xml/features/dom/include-ignorable-whitespace

True:  Includes text nodes that can be considered "ignorable 
whitespace" in the DOM tree.
False:   Does not include ignorable whitespace in the DOM tree.
Default:  true
Note: The only way that the parser can determine if text is ignorable 
is by reading the associated grammar and having a content model for 
the document. When ignorable whitespace text nodes are included in 
the DOM tree, they will be flagged as ignorable. The ignorable flag 
can be  queried by calling the 
TextImpl#isIgnorableWhitespace():boolean  method.

However it should be true by default, and I don't see anything in the 
source that would turn this off.
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo at metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|                  The XML Bible (IDG Books, 1999)                   |
|              http://metalab.unc.edu/xml/books/bible/               |
|   http://www.amazon.com/exec/obidos/ISBN=0764532367/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://metalab.unc.edu/javafaq/ |
|  Read Cafe con Leche for XML News: http://metalab.unc.edu/xml/     |
+----------------------------------+---------------------------------+



More information about the jdom-interest mailing list