[ http://issues.apache.org/jira/browse/XALANJ-952?page=all ]
Brian Minchau updated XALANJ-952: --------------------------------- Version: 2.4 (was: Latest Development Code) > Using Axis.DESCENDANT with a DTMAxisIterator, getLast() causes erronous > results > ------------------------------------------------------------------------------- > > Key: XALANJ-952 > URL: http://issues.apache.org/jira/browse/XALANJ-952 > Project: XalanJ2 > Type: Bug > Components: DTM > Versions: 2.4 > Environment: Operating System: Other > Platform: All > Reporter: Paul Dick > Assignee: Xalan Developers Mailing List > Priority: Minor > > REFER TO NEW TEST TestDTMIterator !! This will require updating xml-xalan/test > directory!!! > Given a string source that is based on the following: > String defaultSource="<?xml version=\"1.0\"?>\n"+ > "<Document>"+ > "<A><B><C><D><E><F/></E></D></C></B></A><Aa/>"+ > "</Document>"; > // Creating an Iterator of Descendants, > DTMAxisIterator iter2 = dtm.getAxisIterator(Axis.DESCENDANT); > iter2.setStartNode(sndChild); // <A> > > // Iterate the axis and print out node info. > int lastNode= 0; > for (int nextNode = iter2.next(); DTM.NULL != nextNode; nextNode=iter2.next()) > { > printNode(dtm, iter2, nextNode, " "); > lastNode = nextNode; > System.out.println("****** lastNode="+dtm.getNodeName(lastNode)); > } > lastNode = iter2.getLast(); // Calling this seems to generate bad results. > // Get a third itertor of Ancestors starting from the last descendant > // of previous iterator, i.e. lastNode. > DTMAxisIterator revIter = dtm.getAxisIterator(Axis.ANCESTOR); > revIter.setStartNode(lastNode); > System.out.println("#### Third Iterator\n"); > // Iterate the axis and print out node info. > for (int nextNode=revIter.next(); DTM.NULL!=nextNode; nextNode=revIter.next()) > printNode(dtm, revIter, nextNode, " "); > } > The results will be all wrong, or an exception will be thrown. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]