commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Per Kreipke" <...@onclave.com>
Subject RE: [jxpath] Using DOM without reloading a file...
Date Thu, 18 Jul 2002 20:03:50 GMT
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
>
>
> --
> To unsubscribe, e-mail:
> <mailto:commons-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:commons-dev-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message