[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: What is the default global context item?

Subject: Re: What is the default global context item?
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 4 May 2020 10:22:41 -0000
 Re: What is the default global context item?
It depends on the processor's API.

For Saxon, we effectively have two kinds of API: legacy APIs where the
"initial match selection" and "global context item" are the same thing, and
3.0-specific APIs where they are set independently. You need to read the specs
for the particular API you are using. By default the global context item is
undefined ("absent").

Some of the 3.0 changes were for streaming - in particular the option to have
an initial match selection (typically the streamed input document) without
having a global context item.

But it's more complex than that: 2.0 allows you to set a global context item
for named-template invocation (where there's no initial match selection), and
even in 1.0, there's some rule somewhere (can't remember if it's in the
language spec or in some API spec) whereby if the initial match selection is a
non-document node, then the global context item is the document root of the
tree containing that node.

Michael Kay
Saxonica

> On 4 May 2020, at 10:53, Erik Siegel <erik@xxxxxxxxxxx> wrote:
>
> Hi all (and maybe especially @Michael Kay <mailto:mike@xxxxxxxxxxxx>)
>
> In implementing XSLT 3 conversions for XProc 3.0 pipelines we ran into this
issue:
>
> What is the global context item for an XSLT 3.0 stylesheet when none is set
explicitly?
>
> Ibve tried to find it in the XSLT 3 spec but found it hard to find the
definite answer. In practice however (for XML conversions)  I noticed itbs
the document-node of the main input document. But is that because the XSLT 3
spec says so or just a convenient default of Saxon?
>
> Hope anyone can help us out,
> Erik Siegel

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.