[jdom-interest] Re: No output for empty elements

Andreas Saremba maillist at saremba.de
Sat Sep 8 08:27:12 PDT 2001

While <sample-elem/> is just another (equivalent) representation for 
<sample-elem></sample-elem>, the complete absence of the empty 
element may well be something completely different.

1) The DTD may require that the element is present (even if it is 
2) Even if the DTD allows the element to be absent, its pure presence 
(despite of empty content) might signal something that is relevant.

It would be very dangerous to offer a feature like 
setDeleteEmptyElements(boolean flag), which might change the validity 
and/or meaning of a document if used without extreme caution. 

Andreas Saremba
Amselweg 19, D-14656 Brieselang

More information about the jdom-interest mailing list