You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Gary Hirschhorn <gh...@fetch.com> on 2009/04/22 17:00:40 UTC

CachedXPathAPI needs to be discarded when new Node is created, or only if Document tree is changed?

Suppose we are using a CachedXPathAPI object.  We then use
Node.createClone() or Document.newElement() to create a new Element that
is owned by the Document, but has no parent and is not in the Document
tree.  Is the CachedXPathAPI object we are using still valid?  Or is the
Document now considered "changed", and we need to create a new
CachedXPathAPI object?

 

Thanks, 

Gary

 


Re: CachedXPathAPI needs to be discarded when new Node is created, or only if Document tree is changed?

Posted by ke...@us.ibm.com.
That should be safe.

______________________________________
"... Three things see no end: A loop with exit code done wrong,
A semaphore untested, And the change that comes along. ..."
  -- "Threes" Rev 1.1 - Duane Elms / Leslie Fish (
http://www.ovff.org/pegasus/songs/threes-rev-11.html)

"Gary Hirschhorn" <gh...@fetch.com> wrote on 04/22/2009 11:00:40 AM:

> "Gary Hirschhorn" <gh...@fetch.com> 
> 04/22/2009 11:00 AM
> 
> To
> 
> <xa...@xml.apache.org>
> 
> cc
> 
> Subject
> 
> CachedXPathAPI needs to be discarded when new Node is created, or 
> only if Document tree is changed?
> 
> Suppose we are using a CachedXPathAPI object.  We then use 
> Node.createClone() or Document.newElement() to create a new Element 
> that is owned by the Document, but has no parent and is not in the 
> Document tree.  Is the CachedXPathAPI object we are using still 
> valid?  Or is the Document now considered "changed", and we need to 
> create a new CachedXPathAPI object?
> 
> Thanks, 
> Gary
>