Closed xml-project closed 4 years ago
?? Doesn't "absent" in practice mean, within your stylesheet: The empty sequence?
So, on a global level, when there is no global context item: empty(/)
is true?
I don't necessarily disagree, I just don't dig the difference between "absent" and "the empty sequence".
If absent doesn't mean "the empty sequence", then empty(/)
would result in an error?
Sorry for not being precise: I am talking about XProc -> XSLT, not how an absent GCI is represented in the stylesheet. The specs say, the XProc implementation should set the global context item to () when calling the XSLT processor. This is not possible with Saxon because it expects an instance of XdmItem. I think this is in accordance with the XSLT specs.
The distinction between 'absent' and 'empty sequence' is generally that attempts to refer to an absent item raise an error. I think what we mean to say is that if a sequence of documents appears, the global context item will be absent. (I.e., we won't attempt to set it to anything.)
At the risk that I'm forgetting some previous discussion, does it make more sense to simply say that the global-context-item is specified if and only if the p:xslt step explicitly sets it? I imagine that most stylesheets take their input from the initial match selection anyway.
@ndw I think this is what I did with PR #412 . What did I miss?
It's fine. I was mostly answering question about the distinction between empty and absent.
I don't really undertand the motivation for ever setting the global-context-item by default, but I think I lost that argument so I'm not trying to reopen the issue. Merge at will!
Sorry, but it is not possible to implement our current ruling with Saxon. We say
There is no way to set the global context item to the empty sequence. It is an item, so it is either present or absent.