[jdom-interest] Reusable JDOM Elements

Malachi de AElfweald malachi at tremerechantry.com
Mon Nov 11 00:22:16 PST 2002

Could you clarify that? I mean, if you are just taking these subtrees,
adding them to an empty document, then using XMLOutputter, you can
skip the document step (ie: XMLOutputter.output(Element, stream)).....

Can you give an example?


11/10/2002 5:45:03 PM, Martin Schulz <schulz at videotron.ca> wrote:

>in a potentially busy server environment, I preconstruct and cache
>potentially many JDOM
>subtrees. Comes usage time, the subtree gets cloned and attached to a
>real Document, which is subsequently output to XML and
>sent out.
>It appears wasteful to have to clone the Elements, even if they are not
>going to be changed, for the sole reason
>that they maintain a reference to their parent.  It seems also to be
>slightly convoluted to manage recycling of such subtrees.
>Is there a good pattern or solution out there (JDOM or closely related)
>which allows me to build Document trees, which are only top-to-bottom
>connected or which allows to reuse the constant subtree(s) easily?
>	Martin

More information about the jdom-interest mailing list