[jdom-interest] SAXBuilder enhancement request /2

phil at triloggroup.com phil at triloggroup.com
Sun Mar 31 00:00:49 PST 2002

Alex wrote:
>>>I've always wanted an option that would throw away all whitespace from Elements that have child Elements<<<
It is not only for Elements that have children, because you may have cases liken
Which is an empty list and should not contain any Text node. I think that the options should remove all space only
string, regarding less of the other children.

Dennis wrote:
>>>I've advocated this approach for document models and I'm glad to see it present in dom4j, but I absolutely agree that
this should not be the default<<<
I completly agree: it should be an option, that one can set when dealing with data oriented files. It should not be
activated by default!

Elliot wrote:
>>>This makes me very nervous. It's a common misconception that white space is insignificant in XML. It's not.<<<
I also agree from a pure specification point of view. But this can be relaxed is specific case and it is up to an
application to decide what to do with its data.
The web.xml mentionned by Dennis is a good example fo that. Here a example of a servlet definition, directly copied from
my environment:
      <servlet id="Servlet_1">
Do you think that the whitespaces are significant in that case? If the parser cannot remove them, then the application
will do it and this will add a complexity layer to the application (taking care of unwanted Text nodes).


More information about the jdom-interest mailing list