Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@apache.org Received: (qmail 12831 invoked from network); 25 Jul 2002 22:33:40 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 25 Jul 2002 22:33:40 -0000 Received: (qmail 14038 invoked by uid 97); 25 Jul 2002 22:34:02 -0000 Delivered-To: qmlist-jakarta-archive-commons-dev@jakarta.apache.org Received: (qmail 14022 invoked by uid 97); 25 Jul 2002 22:34:02 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 14010 invoked by uid 98); 25 Jul 2002 22:34:01 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <20020725223342.61217.qmail@web11708.mail.yahoo.com> Date: Thu, 25 Jul 2002 15:33:42 -0700 (PDT) From: Dmitri Plotnikov Reply-To: dmitri@apache.org Subject: RE: [jxpath] Using DOM without reloading a file... To: Jakarta Commons Developers List In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Per, You don't actually have to use a container to work with DOM. JXPath can work with DOM directly. If a value of a property, or a value in a Map or Collection is a Node (any node, not just a Document), JXPath can traverse into it. You only use a Container if you need the delayed loading functionality. There is nothing wrong with the container class you are proposing, but it is not required for the traversal of DOM Nodes. I hope this answers the questions. Sorry for the late response, I have been away on vacation. - Dmitri --- Per Kreipke wrote: > Additional question: > > - how about instantiating a container with any DOM Node, not just a > Document? > > Per > > > It would be nice if JXPath could use an existing DOM model > > without having to > > load it itself. Perhaps this isn't possible in the current system > but... > > > > - why not have an additional constructor for XMLDocumentContainer > which > > simply sets the document? > > > > XMLDocumentContainer(org.w3c.dom.Document doc) > > { > > this.document = doc; > > } > > > > - alternatively, why is the document object private and not > protected such > > that classes can subclass and add their own constructors. > > > > - then objects could serve the DOM from an in memory copy > > > > - manipulate the DOM outside of JXPath and have those changes > > automatically > > reflected. > > > > > > You could just do this by defining a small subclass of Container > yourself: > > > > public class DOMContainer > > { > > Document document; > > > > DOMContainer(Document doc) { this.document = document; } > > > > public Object getValue() { return this.document } > > > > public > > }; > > > > > > or even implementing Container itself on some object that already > > contains a > > DOM object. > > > > > > Any reason XMLDocumentContainer doesn't do this (e.g. JXPath > > caches Pointers > > that invalidates all of this)? > > > > Thanks, > > Per Kreipke __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- To unsubscribe, e-mail: For additional commands, e-mail: