Re: Predicates order of evaluation
Ihe Onwuka <[email protected]> Fri, 18 Sep 2020 20:36:37 -0400
| Newsgroups | gmane.text.xml.saxon.help,gmane.text.xml.xsl.general.mulberrytech |
|---|---|
| Message-ID | <CALfs7+w-8D-MdCEK26mpr0v1q5GEE6VFNPfSUBeH6Y0Sp93AhA@mail.gmail.com> |
On Wed, Sep 16, 2020 at 3:41 AM Michael Kay <mike-JkSD5nQpfvpWk0Htik3J/[email protected]> wrote: > > Not necessarily, for example in-scope-prefixes(..)[parent::*], here the > predicate isn't focus dependent on the LHS. > > > Of course parent::* is focus dependent, like any axis expression. > > This expression gives a type error, because in-scope-prefixes() returns > strings, and parent::* requires the context item to be a node. Saxon will > detect that type error at compile time, so neither of the subexpressions > will ever be evaluated. > > Michael Kay > Saxonica > > Bad example. Here's the real thing. I found myself having to write if (parent::*) then $fRename(name(..),..) else () instead of $fRename(name(..),..) [parent::*] at a pinch I should possibly be able to write $fRename(name(..),..) [current/parent::*] in which case the predicate is not dependent on the evaluating the expression. _______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ [email protected] https://lists.sourceforge.net/lists/listinfo/saxon-help