Project

Profile

Help

Revision 79311295

Added by Michael Kay almost 13 years ago

Fix bug 2538770 - excess endElement() events from walking tiny tree in pull mode starting at element node.

View differences:

latest9.1/bj/net/sf/saxon/tinytree/TinyTreeEventIterator.java
84 84
        boolean lastNode = currentNodeNr + 1 >= tree.numberOfNodes;
85 85
        int nextDepth = (lastNode ? 0 : tree.depth[currentNodeNr+1]);
86 86

  
87
        boolean atEnd = (thisDepth == tree.depth[startNodeNr] && currentNodeNr != startNodeNr);
87
        boolean atEnd = (thisDepth <= tree.depth[startNodeNr] && currentNodeNr != startNodeNr);
88 88

  
89
        if (atEnd && pendingEndEvents == 1) {
89
        if (atEnd && pendingEndEvents >= 1) {
90 90
            pendingEndEvents--;
91 91
            startNodeNr = -1;
92 92
            if (startAtDocument) {

Also available in: Unified diff