mkwan       2002/11/11 08:04:18

  Modified:    java/src/org/apache/xpath/objects XNodeSet.java
  Log:
  For Bugzilla 14406. Handle the side-effect that creating a DTMNodeList
  will change the state of the iterator.
  
  Revision  Changes    Path
  1.22      +8 -1      xml-xalan/java/src/org/apache/xpath/objects/XNodeSet.java
  
  Index: XNodeSet.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xpath/objects/XNodeSet.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- XNodeSet.java     22 Mar 2002 01:04:44 -0000      1.21
  +++ XNodeSet.java     11 Nov 2002 16:04:18 -0000      1.22
  @@ -381,7 +381,14 @@
      */
     public NodeList nodelist() throws javax.xml.transform.TransformerException
     {
  -    return new org.apache.xml.dtm.ref.DTMNodeList(iter());
  +    org.apache.xml.dtm.ref.DTMNodeList nodelist = new 
org.apache.xml.dtm.ref.DTMNodeList(this);
  +    // Creating a DTMNodeList has the side-effect that it will create a clone
  +    // XNodeSet with cache and run m_iter to the end. You cannot get any node
  +    // from m_iter after this call. As a fix, we call SetVector() on the 
clone's 
  +    // cache. See Bugzilla 14406.
  +    XNodeSet clone = (XNodeSet)nodelist.getDTMIterator();
  +    SetVector(clone.getVector());
  +    return nodelist;
     }
   
     
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to