No subject


Fri Aug 6 17:04:17 PDT 2004


allows 'parentless' implementations. On the other hand, you will have to
roll your own Node and Element implementations.


/pmn

-----Original Message-----
From: Martin Schulz [mailto:schulz at videotron.ca] 
Sent: Monday, November 11, 2002 2:45 AM
To: jdom-interest at jdom.org
Subject: [jdom-interest] Reusable JDOM Elements


Hi,

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?

Thanks!

	Martin


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.385 / Virus Database: 217 - Release Date: 04/09/2002
 

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com
###########################################

This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.F-Secure.com/
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com

------_=_NextPart_001_01C289BD.203BF620
Content-Type: text/html
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2654.89">
<TITLE>RE: [jdom-interest] Reusable JDOM Elements</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>In the past, I have successfully combined JDOM =
Elements with reference counting.&nbsp; </FONT>
</P>

<P><FONT SIZE=3D2>Once the xml file was generated, I would traverse the =
document from the root element, making detach() calls.</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>--Henry</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Norrman Per [<A =
HREF=3D"mailto:per.norrman at canovia.se">mailto:per.norrman at canovia.se</A>=
] </FONT>
<BR><FONT SIZE=3D2>Sent: Monday, November 11, 2002 4:25 AM</FONT>
<BR><FONT SIZE=3D2>To: 'Martin Schulz'; jdom-interest at jdom.org</FONT>
<BR><FONT SIZE=3D2>Subject: RE: [jdom-interest] Reusable JDOM =
Elements</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Hi,</FONT>
</P>

<P><FONT SIZE=3D2>From a quick glance, it appears that dom4j (<A =
HREF=3D"http://www.dom4j.org" =
TARGET=3D"_blank">http://www.dom4j.org</A>) </FONT>
<BR><FONT SIZE=3D2>allows 'parentless' implementations. On the other =
hand, you will have to roll your own Node and Element =
implementations.</FONT></P>
<BR>

<P><FONT SIZE=3D2>/pmn</FONT>
</P>

<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Martin Schulz [<A =
HREF=3D"mailto:schulz at videotron.ca">mailto:schulz at videotron.ca</A>] =
</FONT>
<BR><FONT SIZE=3D2>Sent: Monday, November 11, 2002 2:45 AM</FONT>
<BR><FONT SIZE=3D2>To: jdom-interest at jdom.org</FONT>
<BR><FONT SIZE=3D2>Subject: [jdom-interest] Reusable JDOM =
Elements</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>Hi,</FONT>
</P>

<P><FONT SIZE=3D2>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.</FONT></P>

<P><FONT SIZE=3D2>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.&nbsp; It seems also to be =
slightly convoluted to manage recycling of such subtrees.</FONT></P>

<P><FONT SIZE=3D2>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?</FONT></P>

<P><FONT SIZE=3D2>Thanks!</FONT>
</P>

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT =
SIZE=3D2>Martin</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>---</FONT>
<BR><FONT SIZE=3D2>Outgoing mail is certified Virus Free.</FONT>
<BR><FONT SIZE=3D2>Checked by AVG anti-virus system (<A =
HREF=3D"http://www.grisoft.com" =
TARGET=3D"_blank">http://www.grisoft.com</A>).</FONT>
<BR><FONT SIZE=3D2>Version: 6.0.385 / Virus Database: 217 - Release =
Date: 04/09/2002</FONT>
<BR><FONT SIZE=3D2>&nbsp;</FONT>
</P>

<P><FONT =
SIZE=3D2>_______________________________________________</FONT>
<BR><FONT SIZE=3D2>To control your jdom-interest membership: <A =
HREF=3D"http://lists.denveronline.net/mailman/options/jdom-interest/your=
addr at yourhos" =
TARGET=3D"_blank">http://lists.denveronline.net/mailman/options/jdom-int=
erest/youraddr at yourhos</A></FONT>
<BR><FONT SIZE=3D2>t.com</FONT>
<BR><FONT SIZE=3D2>###########################################</FONT>
</P>

<P><FONT SIZE=3D2>This message has been scanned by F-Secure Anti-Virus =
for Microsoft Exchange. For more information, connect to <A =
HREF=3D"http://www.F-Secure.com/" =
TARGET=3D"_blank">http://www.F-Secure.com/</A> =
_______________________________________________</FONT></P>

<P><FONT SIZE=3D2>To control your jdom-interest membership: <A =
HREF=3D"http://lists.denveronline.net/mailman/options/jdom-interest/your=
addr at yourhost.com" =
TARGET=3D"_blank">http://lists.denveronline.net/mailman/options/jdom-int=
erest/youraddr at yourhost.com</A></FONT></P>

</BODY>
</HTML>
------_=_NextPart_001_01C289BD.203BF620--



More information about the jdom-interest mailing list