AW: [jdom-interest] Using JDOM to manipulate HTML

Börries Ludwig Boerries.Ludwig at
Wed Feb 13 00:26:53 PST 2002

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 (&#160 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
> [mailto:jdom-interest-admin at]Im Auftrag von Eric Ace
> Gesendet: Dienstag, 12. Februar 2002 22:28
> An: jdom-interest at
> 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 
> the DOM in JavaScript.
> Am I completely missing the spirit of JDOM? Or, missing some 
> fundamentally obvious point?
> Thanks
> -EAce
> _______________________________________________
> To control your jdom-interest membership:
dr at

More information about the jdom-interest mailing list