Return-Path: Delivered-To: apmail-xml-general-archive@www.apache.org Received: (qmail 26861 invoked from network); 16 Apr 2006 06:17:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 16 Apr 2006 06:17:08 -0000 Received: (qmail 37949 invoked by uid 500); 16 Apr 2006 06:17:06 -0000 Delivered-To: apmail-xml-general-archive@xml.apache.org Received: (qmail 37904 invoked by uid 500); 16 Apr 2006 06:17:06 -0000 Mailing-List: contact general-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: general@xml.apache.org List-Id: Delivered-To: mailing list general@xml.apache.org Received: (qmail 37892 invoked by uid 99); 16 Apr 2006 06:17:06 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Apr 2006 23:17:06 -0700 X-ASF-Spam-Status: No, hits=1.4 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: 63.240.77.84 is neither permitted nor denied by domain of hoju@visi.com) Received: from [63.240.77.84] (HELO sccrmhc14.comcast.net) (63.240.77.84) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Apr 2006 23:17:05 -0700 Received: from nicki.visi.com (c-66-41-141-26.hsd1.mn.comcast.net[66.41.141.26]) by comcast.net (sccrmhc14) with SMTP id <20060416061643014008470re>; Sun, 16 Apr 2006 06:16:44 +0000 Message-Id: <7.0.1.0.0.20060416010355.00adfb60@syntegra.com> X-Mailer: QUALCOMM Windows Eudora Version 7.0.1.0 Date: Sun, 16 Apr 2006 01:17:10 -0500 To: general@xml.apache.org From: Jacob Kjome Subject: best approach to whole document cloning in Xerces2? Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Relayed-By: GPGrelay Version 0.959 (Win32) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N I'm wondering what's the best approach to cloning an entire document? Would it be better to keep a master copy in memory and then create a new document and import the other document in there, or would it be better to simply reparse the document every time (where the document is used over and over again as a template, a copy is created and manipulated on each HTTP request, then serialized to the browser)? If I keep the document in memory and know I am dealing with the Xerces2 implementation, can I just call cloneNode(true) and get an identical copy of the whole document, including doctype, entities, entity references, etc...? Again, would this be more efficient than reparsing the document each time with, say, the Xerces2 DOMParser? Is there a clear-cut answer to this, or does it depend on document size or other aspect of the document or environment? thanks, Jake --------------------------------------------------------------------- To unsubscribe, e-mail: general-unsubscribe@xml.apache.org For additional commands, e-mail: general-help@xml.apache.org