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 29461 - [xslt30] Clarify effect of document("") when the source stylesheet is not available at run-time
Summary: [xslt30] Clarify effect of document("") when the source stylesheet is not ava...
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Candidate Recommendation
Hardware: PC All
: P2 normal
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-02-15 09:40 UTC by Michael Kay
Modified: 2016-05-27 11:38 UTC (History)
1 user (show)

See Also:


Attachments

Description Michael Kay 2016-02-15 09:40:17 UTC
We should clarify that there is no guarantee the source stylesheet will be available at runtime (and accessible using document(""). This relates to the more general issue of static-base-uri() when used at run-time if the source stylesheet is not available.
Comment 1 Abel Braaksma 2016-02-16 09:17:23 UTC
And/or the same call in a static expression?
Comment 2 Michael Kay 2016-02-16 09:58:09 UTC
Noted that we have the basics in place to say that static base URI may not necessarily be the source stylesheet location: see description of static base URI in XPath, the description of the static-base-uri() function in F&O, and section 5.8 of XSLT.

Section 20.1 needs updating to reflect this.

Left this with an action on the editor to propose specific words to update the spec of document() to reflect the flexibility now allowed on static-base-uri().
Comment 3 Michael Kay 2016-02-23 22:44:12 UTC
Proposal.

(a) In 5.3.1, replace the entry for static base URI as follows:

static base URI: In a conventional interpreted environment, the static base URI of an expression in the stylesheet is the base URI of the containing element in the stylesheet. The concept of the base URI of a node is defined in Section 5.2 base-uri Accessor DM30

In an environment where stylesheets are executed in a location where no source code is present (for example, because the code of the stylesheet has been compiled and is distributed as executable object code), it is *recommended* (subject to operational constraints such as security) that the static base URI used during stylesheet evaluation should be the location from which the stylesheet was loaded for execution (its "deployed location"). This means, for example, that when the doc or document functions are called with a relative URI, the required document is by default located relative to the deployed location of the stylesheet.

(b) Refer back to this text wherever we rely on the concept of static base URI, e.g. in the stream-available, document, and json-to-xml functions.

(c) In fn:document(), change the first para of the Notes to:

One effect of these rules is that in an interpreted environment where the source code of the stylesheet is available and its base URI is known, then unless XML entities or xml:base are used, the expression document("") refers to the document node of the containing stylesheet module (the definitive rules are in [RFC3986]). The XML resource containing the stylesheet module is then processed exactly as if it were any other XML document, for example there is no special recognition of xsl:text elements, and no special treatment of comments and processing instructions.
Comment 4 Michael Kay 2016-04-01 08:35:22 UTC
The changes were accepted (noting the observations recorded in the minutes of the discussion)
Comment 5 Michael Kay 2016-05-27 11:38:31 UTC
For the record: The changes have been applied (some time ago).