[jdom-interest] generating html content with jdom

guru at stinky.com guru at stinky.com
Wed Jun 27 16:43:21 PDT 2001

On Thu, Jun 28, 2001 at 01:14:27AM +0200, Noam Tamim wrote:
> *  Is it acceptable to use jdom (or any other dom-based application) for
> creating html documents, or I should stick to just out.println() the
> elements myself?

Sure. Why not? As long as you accept the limitations of XMLOutputter
wrt whitespace and stuff.  JDOM generates street-legal close tags for 
<br /> and the like.

> *  what's the best way to send a space character? I mean, there's a table
> cell (<td>) that's supposed to be empty. With "standard" html I'd use
> "<td>&nbsp;</td>".  Currently what I have is this:
>  new Element("td").addContent(new EntityRef("#160"));
> Is this the right solution?

I'd think new EntityRef("nbsp") would work fine.

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