[jdom-interest] Comment parsing/outputing issues (bug?)

GB/DEV - Philip Nelson philip.nelson at omniresources.com
Thu Feb 22 07:15:28 PST 2001


> It seems that newlines are not preserved in XML documents 
> when parsed by
> JDOM and then output.  I thought that all text in an XML document was
> considered significant, including whitespace.  This is using the
> default, included (Xerces) SAX parser with JDOM-B6.

It looks to me like you may be confusing whitespace in an element and the
whitespace surrounding tags.  There is an option to not preserve whitespace
*within* elements, otherwise that whitespace is preserved.  As for the
outputting of the tags, this is higly controllable with the Outputter.  To
my knowledge, the exact format of the original whitespace between elements
is not preserved, nor does the xml spec required that.



More information about the jdom-interest mailing list