[jdom-interest] Incorrect output

Elliotte Rusty Harold elharo at metalab.unc.edu
Thu Jun 29 04:32:00 PDT 2000


At 7:34 PM -0700 6/28/00, Jason Hunter wrote:
>> ><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.
>

I missed that. It does seem to be a real bug. Can we get the code and 
sample files that do this so we can take a look? Also useful to know 
would be what parser you're using. It's not necessarily a bug in 
XMLOutputter, though it could well be. There are a couple of other 
points in the system where info could be lost.

As to white space, I continue to maintain that keeping it should be 
the default behavior, and that throwing it away without an explicit 
request is non-intuitive and will confuse people. But we've  already 
been through this one.

+-----------------------+------------------------+-------------------+
| 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