This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 29802 - [XSLT30] (largely editorial) The description of the initial value for global parameters seems too narrow
Summary: [XSLT30] (largely editorial) The description of the initial value for global ...
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC Windows NT
: P2 trivial
Target Milestone: ---
Assignee: Michael Kay
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-02 14:34 UTC by Abel Braaksma
Modified: 2016-09-03 22:14 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2016-09-02 14:34:37 UTC
The definition for the global context item describes how it is applicable to global variables (section 2.3.2 Priming a stylesheet):

"[Definition: An item that acts as the global context item for the transformation. This item is accessible as the initial value of the XPath expressions . (dot) and self::node() appearing within the select expression or sequence constructor of a global variable declaration within the top-level package, as described in 5.3.3.1 Maintaining Position: the Focus. ]"

(Editorial: also note the excessive space at the end.)

This suggests that "this item" it not accessible in other ways. But suppose you have <xsl:variable name="x" select="/" />, or <xsl:variable name="y" select="foo" />. It should also be applicable to such expressions. The global context item does not need to be a (rooted) node.

I propose therefore to change it perhaps like this:

"[Definition: An item that acts as the *global context item* for the transformation. This item acts as the initial *focus* for the select expression or sequence constructor of a *global variable* declaration within the *top-level* package, as described in 5.3.3.1 Maintaining Position: the Focus.]"

Also editorial in this section: "If the initialization of any global variables or parameter depends" >> "...any global variables or parameters..." (missing "s").
Comment 1 Abel Braaksma 2016-09-02 15:16:45 UTC
In the section on call-template invocation (2.3.4) we use a different way to describe the initial focus of template declarations. Perhaps we could borrow from that?

It says:

"The initial named template is evaluated with a singleton focus based on this context item if it exists, or with an absent focus otherwise."

Which could be applied to our definition something like this:

"[Definition: An item that acts as the *global context item* for the transformation. *Global variables* are evaluated with a *singleton focus* based on the global context item, or with absent focus if it is absent.]"

Note that this section (2.3.2), while it describes the process of priming the stylesheet and the definition of the global context item, does not mention that it is also used for the aforementioned initial named template.
Comment 2 Michael Kay 2016-09-03 22:14:22 UTC
I have changed the text to:

<p><termdef id="dt-global-context-item" term="global context item"><phrase
   diff="chg" at="R-bug24764">An item that acts as the <term>global
    context item</term> for the transformation.</phrase> This item acts
  as the <termref def="dt-context-item"/> when evaluating
   <phrase diff="chg" at="R-bug24549"> the
   <code>select</code> expression or sequence constructor of a
  <termref def="dt-global-variable"/> declaration</phrase>
  <phrase diff="add" at="R-bug25611">within the <termref
   def="dt-top-level-package"/></phrase>, as described in <specref
   ref="focus"/>. The global context item may also be available in a named template
    when the stylesheet is invoked as described in <specref ref="invoking-initial-template"/></termdef>.</p>