Re: key function - document node
Michael Kay <mike-JkSD5nQpfvpWk0Htik3J/[email protected]>
| Newsgroups | gmane.text.xml.saxon.help |
|---|---|
| Message-ID | <[email protected]> |
It's all there in the spec: [ERR XTDE1270] <>It is a dynamic error <https://www.w3.org/TR/xslt-30/#dt-dynamic-error> to call the key <https://www.w3.org/TR/xslt-30/#func-key> function with two arguments if there is no context node <https://www.w3.org/TR/xslt-30/#dt-context-node>, or if the root of the tree containing the context node is not a document node; or to call the function with three arguments if the root of the tree containing the node supplied in the third argument is not a document node. Michael Kay Saxonica > On 3 Sep 2020, at 20:46, Ihe Onwuka <[email protected]> wrote: > > Well I only got a correct result by wrapping an xsl:document around element in the variable ......shrugs. > > > On Thu, Sep 3, 2020 at 2:57 PM Michael Kay <mike-JkSD5nQpfvpWk0Htik3J/[email protected] <mailto:mike-JkSD5nQpfvpWk0Htik3J/[email protected]>> wrote: > No, it should produce the correct result ;-) > > The third parameter scopes the result; nodes will only be selected by the key() function if they are withing the subtree rooted at the node given in the third argument. > > Michael Kay > Saxonica > >> On 3 Sep 2020, at 19:18, Ihe Onwuka <[email protected] <mailto:[email protected]>> wrote: >> >> I amended an invocation to the key function wherein the 3rd parameter was not a document node but was a variable with an element type declaration. I got no error or warning but the stylesheet executed to completion and provided the wrong result. >> >> Is this what should happen? >> _______________________________________________ >> saxon-help mailing list archived at http://saxon.markmail.org/ <http://saxon.markmail.org/> >> [email protected] <mailto:[email protected]> >> https://lists.sourceforge.net/lists/listinfo/saxon-help <https://lists.sourceforge.net/lists/listinfo/saxon-help> _______________________________________________ saxon-help mailing list archived at http://saxon.markmail.org/ [email protected] https://lists.sourceforge.net/lists/listinfo/saxon-help