[jdom-interest] empty elements

Brett McLaughlin brett at newInstance.com
Tue Jul 17 16:33:42 PDT 2001

> Here's a rather silly question...
> I notice XMLOutputter outputs empty elements as
> <element /> (with a space between the element name and the slash)
> Is this legal XML (it has to be, right?), and is there an easy way to
> get rid of that space?

It is legal, and it's there because of annoyances like Netscape browsers
which fail on <br/> but not on <br />. Both are legal XML.

I don't know of any way to get rid of it, because we've never had a good
reason to provide a way.

Brett McLaughlin
Enhydra Strategist:   http://www.enhydra.org
Lutris Technologies: http://www.lutris.com
O'Reilly Author:       http://www.newInstance.com

More information about the jdom-interest mailing list