Fwd: Predicates order of evaluation

Ihe Onwuka <[email protected]> Tue, 15 Sep 2020 19:23:02 -0400
Newsgroups gmane.text.xml.saxon.help,gmane.text.xml.xsl.general.mulberrytech
Message-ID <CALfs7+yKADYGiFRCKVF9jiUT5ff-AnYzP_CMqEMWBVL1etqN_g@mail.gmail.com>
---------- Forwarded message ---------
From: Ihe Onwuka <[email protected]>
Date: Tue, Sep 15, 2020 at 7:21 PM
Subject: Re: [saxon] Predicates order of evaluation
To: Michael Kay <mike-JkSD5nQpfvpWk0Htik3J/[email protected]>




On Tue, Sep 15, 2020 at 6:07 PM Michael Kay <mike-JkSD5nQpfvpWk0Htik3J/[email protected]> wrote:

>
> Seeing as you can recast A[B] as  (if B then A else ())  does that mean it
> depends on how you write it?
>
>
> You can only do that rewrite if B is focus-independent.
>

I believe the scenario I stated allows B to be focus-independent of A.

>
>
>
> Ok a[b] as in a[parent::*] where a is a function or expression that fails
> if the context node does not have a  parent element
>
>
>>
>
The above doesn't necessarily mean that a sets the context for B.



> Here you have a predicate that's focus dependent.
>

 Not necessarily, for example  in-scope-prefixes(..)[parent::*], here the
predicate isn't focus dependent on the LHS. Neither would it be in a case
where the context in the predicate was set by a call to the current()
function.

So in those cases you should be able to evaluate the predicate first.
Correct?

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[email protected]
https://lists.sourceforge.net/lists/listinfo/saxon-help