[jdom-interest] Re: XMLOutputter testing

Bradley S. Huffman hip at a.cs.okstate.edu
Wed Feb 6 07:14:25 PST 2002


Jason Hunter writes:

> The only thing I found is that if you turn text normalization on, then
> XHTML-style output is altered.  For example:
> 
> <body>
> Here goes  the <i> body</i> and a <a href="foo.html">link</a>.
> </body>
> 
> becomes
> 
> <body>Here goes the<i>body</i>and a<a href="foo.html">link</a>.</body>
> 
> and I personally always wanted something more like
> 
> <body> Here goes the <i> body</i> and a <a href="foo.html">link</a>.
> </body>

That's the problem, everyone has their own view of what's best :) I was
thinking about a text indent mask to give the user a finer grain of control.
They could mask off indentation for text between start/start, start/end,
end/start, and end/end tags (the 4 cases where text can occur).  I haven't
done it yet because, well, I still think there's a better way do this (don't
know what it is yet, but I think there's one).

> OK, I did a little more advanced testing and found another little bug in
> the xml:space behavior if trim all white is turned on.
> 
> This file:
> 
> <body xml:space="preserve">
> Here goes  the <i xml:space="default"> body</i> and a <a
> xml:space="preserve" href="foo.html">link</a>.
> </body>
> 
> becomes
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <body xml:space="preserve">
> Here goes  the <i xml:space="default"> body</i> and a <a
> xml:space="preserve" href="foo.html">link</a>.
> </body>
> 
> Which is nearly correct except I think " body" should be "body" because
> the <i> tag set the space flag back to default which is trimming all. 
> Correct?

Correct, you've found a bug.

Brad



More information about the jdom-interest mailing list