Project

Profile

Help

Revision 6e5233f5

Added by Michael Kay over 13 years ago

Fix bugs 201449 and 2014854 (xsl:number problems)

View differences:

latest9.0/bj/net/sf/saxon/om/Navigator.java
355 355
        NodeInfo memoNode = null;
356 356
        int memoNumber = 0;
357 357
        Controller controller = context.getController();
358
        boolean memoise = (!hasVariablesInPatterns);
358
        boolean memoise = (!hasVariablesInPatterns) && from==null;
359 359
        if (memoise) {
360 360
            Object[] memo = (Object[])controller.getUserData(inst, "xsl:number");
361 361
            if (memo != null) {
latest9.0/bj/net/sf/saxon/pattern/LocationPathPattern.java
408 408
    public boolean matches(NodeInfo node, XPathContext context) throws XPathException {
409 409
        // if there is a variable to hold the value of current(), bind it now
410 410
        if (variableBinding != null) {
411
            variableBinding.evaluateItem(context);
411
            XPathContext c2 = context;
412
            Item ci = context.getContextItem();
413
            if (!(ci instanceof NodeInfo && ((NodeInfo)ci).isSameNodeInfo(node))) {
414
                c2 = context.newContext();
415
                UnfailingIterator si = SingletonIterator.makeIterator(node);
416
                si.next();
417
                c2.setCurrentIterator(si);
418
            }
419
            variableBinding.evaluateItem(c2);
412 420
        }
413 421
        return internalMatches(node, context);
414 422
        // matches() and internalMatches() differ in the way they handle the current() function.

Also available in: Unified diff