[jdom-interest] Code Submission: org.jdom.output.HTMLOutputte r

James Strachan james at metastuff.com
Fri Nov 17 02:13:50 PST 2000

----- Original Message -----
From: "Jason Hunter" <jhunter at collab.net>
> > I specifically wrote HTMLOutputter purely because HTML can't
> > handle CDATA.
> Is CDATA the only thing a browser wouldn't understand?  (IOW, would a
> browser familiar only with HTML 3.2 be able to take XMLOutputter info
> and understand it except for CDATA?)

Not necessarily. I'm sure there's a few others.
For example it would be nice to turn all empty elements of the following
into their HTML versions.

<p/>     => <p>
<br/>    => <br>

Though this would mean more refactoring work on XMLOutputter to implement
I'm not saying HTMLOutputter is complete in any way, its just a start in the
right direction ;-)

> Also, James, I'd think you would need to call escapeElementEntities()
> for the cdata.getText().  To what extent did you test this?

The CDATA was the thing that the browsers couldn't handle for the output I
was generating.
I had HTML entities in CDATA sections (&quote; &pound; et al) that when I
used the new HTMLOutputter worked fine in IE5.5 and Netscape 6.

> P.S.  I'm making escape*Entities() protected from private to enable this
> kind of feature for custom XMLOutputter subclasses.

Cool - thanks.


James Strachan
email: james at metastuff.com
web: http://www.metastuff.com

If you are not the addressee of this confidential e-mail and any
attachments, please delete it and inform the sender; unauthorised
redistribution or publication is prohibited. Views expressed are those of
the author and do not necessarily represent those of Citria Limited.

More information about the jdom-interest mailing list