Project

Profile

Help

Revision c04e0e5c

Added by Michael Kay over 12 years ago

Fix bug 2819671 Value of position() not maintained when navigating DOMSource

View differences:

latest9.1/bj/net/sf/saxon/dom/NodeWrapper.java
1163 1163
                if (forwards) {
1164 1164
                    ix += currentSpan;
1165 1165
                    if (ix >= childNodesLength) {
1166
                        position = -1;
1166 1167
                        return null;
1167 1168
                    } else {
1168 1169
                        currentSpan = skipFollowingTextNodes();
......
1181 1182
                        }
1182 1183
                        NodeWrapper wrapper = makeWrapper(currentDomNode, docWrapper, commonParent, ix);
1183 1184
                        wrapper.span = currentSpan;
1185
                        position++;
1184 1186
                        return current = wrapper;
1185 1187
                    }
1186 1188
                } else {
1187 1189
                    ix--;
1188 1190
                    if (ix < 0) {
1191
                        position = -1;
1189 1192
                        return null;
1190 1193
                    } else {
1191 1194
                        currentSpan = skipPrecedingTextNodes();
......
1205 1208
                        }
1206 1209
                        NodeWrapper wrapper = makeWrapper(currentDomNode, docWrapper, commonParent, ix);
1207 1210
                        wrapper.span = currentSpan;
1211
                        position++;
1208 1212
                        return current = wrapper;
1209 1213
                    }
1210 1214
                }

Also available in: Unified diff