Java <table> generator

Discussion in 'HTML' started by Rick DeBay, Nov 7, 2003.

  1. Rick DeBay

    Rick DeBay Guest

    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


    remove INHIBITIONS to reply
    Rick DeBay, Nov 7, 2003
    #1
    1. Advertising

  2. Rick DeBay wrote:

    > 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/

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Nov 7, 2003
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Martin Maurer
    Replies:
    3
    Views:
    4,823
    Peter
    Apr 19, 2006
  2. TheDustbustr
    Replies:
    1
    Views:
    447
    Sami Hangaslammi
    Jul 25, 2003
  3. Replies:
    9
    Views:
    537
  4. Chris Withers

    Problems with email.Generator.Generator

    Chris Withers, Sep 11, 2006, in forum: Python
    Replies:
    20
    Views:
    1,689
    Max M
    Sep 12, 2006
  5. Terry Reedy

    Generator functions subclass generator?

    Terry Reedy, Jun 18, 2009, in forum: Python
    Replies:
    0
    Views:
    458
    Terry Reedy
    Jun 18, 2009
Loading...

Share This Page