[jdom-interest] Incorrect output

Jason Hunter jhunter at collab.net
Wed Jun 28 19:34:29 PDT 2000

> ><my_doc>
> >  <hf_text>
> >    <a href="test"></a>
> >  </hf_text>
> >  <hf_text>
> >    <a href="test"></a>
> >    -- URL to the left
> >  </hf_text>

> >The output I get is:
> ><my_doc>
> >  <hf_text>
> >    <a href="test" />
> >  </hf_text>
> >  <hf_text>-- URL to the left</hf_text>

> After a quick look, it seems to be a feature not a bug.

> For instance, from the perspective of XML there is NO
> difference between <a href="test"></a> and <a href="test" />. No
> application should treat these as different.

Best take a closer look, Elliotte.  :-)  Look at the second <hf_text>. 
In the "Before" it contained an <a> element.  In the "After" that
element disappeared.  That's a bug.

> Some of the white space problems you report are a problem with JDOM,
> not with XML. I agree with you that JDOM should preserve the white
> space. I also claim that the XMl specification requires this. However
> not everyone else agrees with us about this. Perhaps you can convince
> Brett and Jason why this is important. I could not. :-)

You misrepresent the situation here!  We agreed whitespace is important
and pledged to change the code to keep it (just haven't done it yet). 
Full whitespace info will be available for outputters to use via
getMixedContent(true).  See my previous email for a possible nice way to
configure whether you want whitespace preserved in output or not -- I'm
getting tired of constructor flags.

Brett, changing whitespace is your baby.  Any comments on estimated time
to completion?


More information about the jdom-interest mailing list