[jdom-interest] Another TODO item

guru at stinky.com guru at stinky.com
Tue Jun 19 09:27:06 PDT 2001


* Fix unconfirmed bug of unwanted line breaks occurring between tags.
  http://lists.denveronline.net/lists/jdom-interest/2000-October/003241.html

So now we get behavior that's different from that reported in the
above.  I'm not sure what the right behavior is.

From:

new Document
	    ( new Element("nulltest")
	      .addContent( new Element("name").setText(null) )
	      .addContent( new Element("name").setText("") ));

and

new XMLOutputter("  ", true);

we get 

<?xml version="1.0" encoding="UTF-8"?>
<nulltest>
  <name />
  <name />
</nulltest>


I believe this is correct behavior.  We're not stripping whitespaces;
there is actually no text in the elements.  In one there is a null, in
the other an empty string, but neither of those should count as
text. An empty element is an empty element, right?

If you agree that this is correct, you can tick it off the todo list.

-- 
Alex Chaffee                       mailto:alex at jguru.com
jGuru - Java News and FAQs         http://www.jguru.com/alex/
Creator of Gamelan                 http://www.gamelan.com/
Founder of Purple Technology       http://www.purpletech.com/
Curator of Stinky Art Collective   http://www.stinky.com/



More information about the jdom-interest mailing list