commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Kreipke" <>
Subject [jxpath] Using DOM without reloading a file...
Date Thu, 18 Jul 2002 17:06:53 GMT
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

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 }


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)?

Per Kreipke

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message