Project

Profile

Help

Revision 6586d55b

Added by Michael Kay over 1 year ago

Fix bug #4730

View differences:

latest10/hej/net/sf/saxon/expr/SlashExpression.java
942 942
        // without removal of duplicates. If sorting and deduplication are needed,
943 943
        // this is achieved by wrapping the path expression in a DocumentSorter
944 944

  
945
        if (contextFree) {
945
        Expression step = getStep();
946
        if (contextFree && step instanceof AxisExpression) {
947
            // see bug 4730, the step might have been rewritten since the flag was set
946 948
            return new MappingIterator(
947 949
                    getStart().iterate(context),
948
                    item -> ((AxisExpression) getRhsExpression()).iterate((NodeInfo)item));
950
                    item -> ((AxisExpression) step).iterate((NodeInfo)item));
949 951
        }
950 952

  
951 953
        XPathContext context2 = context.newMinorContext();
952 954
        context2.trackFocus(getStart().iterate(context));
953
        return new ContextMappingIterator(c1 -> getStep().iterate(c1), context2);
955
        return new ContextMappingIterator(step::iterate, context2);
954 956
    }
955 957

  
956 958
//    /**

Also available in: Unified diff