[jdom-interest] XMLOutputter

Phil Weighill-Smith phil.weighill-smith at volantis.com
Thu Feb 12 08:18:22 PST 2004


Note that the JDOM SAXBuilder will incorporate ignorable whitespace into
your JDOM tree (i.e. when loading an XML file) as text "nodes" filled
with whitespace by default. You must invoke
SAXBuilder#setIgnoringElementContentWhitespace(boolean) with true to
ensure that, when using a validating parser, ignorable whilespace is
ignored.

Phil :n)

On Thu, 2004-02-12 at 15:26, Elliotte Rusty Harold wrote:

> At 8:00 AM -0500 2/12/04, Rolf Lear wrote:
> >You have a bunch of problems ....
> >
> >Firstly, white-space in XML has no meaning unless specifically requested
> >(xml:space="preserve"). Thus, the following two XML documents are
> >equivalent:
> ><root><element>text</element></root>
> >and
> ><root>
> >   <element>text</element>
> ></root>
> >
> 
> This statement is false. The two document above are *not* equivalent, 
> at least at the level of XML.
> 
> Conformant XML parsers preserve and report all white space in XML 
> content (i.e. outside of tags) regardless of the setting of 
> xml:space, or its presence or absence. The interpretation of that 
> white space is an aplicaiton level decision made by each program that 
> reads the XML through a parser, as in the interpreation of any other 
> non-whitespace data. See Chapter 10 of Effective XML for more 
> elaboration of this point.

-- 
Phil Weighill-Smith <phil.weighill-smith at volantis.com>
Volantis Systems
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://jdom.org/pipermail/jdom-interest/attachments/20040212/cff3613a/attachment.htm


More information about the jdom-interest mailing list