AW: [jdom-interest] Using JDOM to manipulate HTML
jonbaer at digitalanywhere.com
Wed Feb 13 03:12:32 PST 2002
Not sure if it relates but from the TODO:
* Consider an HTMLBuilder that reads not-necessarily-well-formed HTML and
produces a JDOM Document. The approach I'd suggest is to build on top of
JTidy first. That gives a working implementation fast, at the cost of a
157K Tidy.jar in the distribution. After that, perhaps someone would lead
an effort to change the JTidy code to build a JDOM Document directly,
instead of making a DOM Document or XML stream first. That would be a lot
faster, use less memory, and make our dist smaller. See
http://www.sourceforge.net/projects/jtidy for Tidy.
Börries Ludwig wrote:
> Hi Eric,
> I do the same thing. The biggest disadvantage of Struts is, that a page cannot be edited in an ordinary HTML-editor. The disadvantage of using XML/JDOM is, that I have to correct the tags, produced from the HTML-editor, to correct XML-syntax and that I couldn't use some html-elements (  instead of ).
> What I still miss is a library wich makes the manipulation of a HTML/JDOM-representation more easily. It took me some time to get an Element of a table by ID, get the parent of the ID, dublicate the Element with my model, and delete the original element. To add complete HTML-fragments to JDOM was to implement, too.
> I used pure Xerces at the beginning, but JDOM made the manipulation of elements much easier.
> Hope we can share our experiences.
> Viele Gruesse
> Boerries Ludwig
> > -----UrsprÃ¼ngliche Nachricht-----
> > Von: jdom-interest-admin at jdom.org
> > [mailto:jdom-interest-admin at jdom.org]Im Auftrag von Eric Ace
> > Gesendet: Dienstag, 12. Februar 2002 22:28
> > An: jdom-interest at jdom.org
> > Betreff: [jdom-interest] Using JDOM to manipulate HTML
> > I want to use JDOM to manage presentation. Instead of using
> > custom tags a la Struts, my thought is to have a presentation
> > tier that queries business components and merges data into static
> > HTML via JDOM. So, I need to be able to locate specific HTML
> > elements by name or ID and modify them. For example:
> > <html>
> > ...
> > <table id="tbl1">
> > <!-- Use Presentation component + JDOM to insert rows -->
> > </table>
> > I can ultimately get to the table I need to manipulate by getting
> > all "table" elements, then looking for one that contains an ID
> > attribute. What would be more programmatically clean though would
> > be to manipulate the document via JDOM similarly to how I can via
> > Am I completely missing the spirit of JDOM? Or, missing some
> > fundamentally obvious point?
> > Thanks
> > -EAce
> > _______________________________________________
> > To control your jdom-interest membership:
> > http://lists.denveronline.net/mailman/options/jdom-interest/yourad
> dr at yourhost.com
> To control your jdom-interest membership:
More information about the jdom-interest