Is there a Java API for creating a XHTML document?

Posted by Bedwyr Humphreys on Stack Overflow See other posts from Stack Overflow or by Bedwyr Humphreys
Published on 2010-04-11T15:53:25Z Indexed on 2010/04/11 17:53 UTC
Read the original article Hit count: 358

Filed under:
|
|
|
|

I want to provide a simple XHTML representation of each of the resources in a REST web service.

At the moment i'm using a StringBuilder to generate these which is both tedious and error prone. I don't see these changing after I publish the service but the process of coding each is a bit painful.

Is there a XHTML document writer api? Should I just use an XML writer? Which one? Should I just roll my own basic HTML document class - doctype is the same each time, i just need to set the title, metatags and body content, most of which (but not all content) is already in HTML for the GETs.

Or should I just use StringBuilder and stop whining? ;)

Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about rest