sboag       01/06/29 09:24:11

  Modified:    java/src/org/apache/xml/dtm/ref/dom2dtm DOM2DTM.java
  Log:
  Change getHandleFromNode(Node node) to call nextNode.  Should
  fix bug with XPathAPI (and extensions) where element out of bounds
  exception occurs.
  
  Revision  Changes    Path
  1.8       +15 -6     xml-xalan/java/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java
  
  Index: DOM2DTM.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DOM2DTM.java      2001/06/21 21:13:38     1.7
  +++ DOM2DTM.java      2001/06/29 16:24:06     1.8
  @@ -598,18 +598,27 @@
      */
     private int getHandleFromNode(Node node)
     {
  -    // %TBD% Will this ever be called with Nodes that haven't yet been built?
  -    // Do we need to be prepared to call nextNode()?
       if (null != node)
       {
  -      int len = m_nodes.size();
  -      for (int i = 0; i < len; i++)
  +      int len = m_nodes.size();        
  +      boolean isMore;
  +      int i = 0;
  +      do
  +      {          
  +        for (; i < len; i++)
           {
             if (m_nodes.elementAt(i) == node)
  -            return i | m_dtmIdent;
  +            return i | m_dtmIdent;         
           }
  -    }
   
  +        isMore = nextNode();
  +  
  +        len = m_nodes.size();
  +            
  +      } 
  +      while(isMore || i < len);
  +    }
  +    
       return DTM.NULL;
     }
   
  
  
  

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

Reply via email to