Java <table> generator

R

Rick DeBay

I've got to write some code that takes portions of an HTML document and arranges
some of the content in to cells in a table, while preserving all the surrounding
tags and making sure the output is still valid HTML.
While I could simply write the code that searches for the specific items and
repeatedly copy the needed inline tags within the block tags (table cells) that
will contain these items, that's being awfully specific with little chance of
reuse.

I'd like to come up with a class that can take any block of HTML and reprocess
it in to a table. I'm thinking it could be used to transform lists (DL, OL, UL)
or organize unstructured content given certain rules.

Unfortunately I'm drawing a blank, and can't figure out a good generic, robust,
extensible way to design this. Does anyone have any suggestions?

Thanks, Rick DeBay
(e-mail address removed)

remove INHIBITIONS to reply
 
T

Toby A Inkster

Rick said:
I've got to write some code that takes portions of an HTML document and arranges
some of the content in to cells in a table, while preserving all the surrounding
tags and making sure the output is still valid HTML.

For the validity requirement, look at http://tidy.sourceforge.net/. There
is a Java version available. It should be possible to pass your end result
though it before sending it off to the browser.

Alternatively, mod_tidy: http://home.snafu.de/tusk/mod_tidy/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,677
Members
48,796
Latest member
Greg L.

Latest Threads

Top