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 25611 - [xslt 3.0] What whitespace-stripping rules apply to the global context item?
Summary: [xslt 3.0] What whitespace-stripping rules apply to the global context item?
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Working drafts
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: 2014-05-08 17:27 UTC by Michael Kay
Modified: 2014-05-22 22:07 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2014-05-08 17:27:23 UTC
We allow whitespace-stripping rules to vary from one package to another. For things like doc() and xsl:stream, the rules that apply are the rules for the package that contains the relevant instruction. The same applies to the rules for stripping type annotations.

What rules should apply to the global context item?

We say that all packages get the same global context item, so we can't apply different rules in different packages. But if a package is written with the expectation that whitespace is stripped, then it could fail unpredictably if whitespace is not stripped; similarly with type annotations.

We could consider going with a different approach. I'm tempted to simplify it radically and say that library packages cannot have a global context item, that is, global variables in a library package are evaluated in the same way as functions, with an absent focus. This means users have a little more work converting existing stylesheet code to act as a library package (essentially by introducing a stylesheet parameter to take the place of the global context item), but they probably have to do this kind of clean-up anyway.
Comment 1 Michael Kay 2014-05-16 13:56:23 UTC
The WG on 2014-05-15 approved the proposal to disallow use of the global context item in the initialization of global variables in library packages, and this has now been incorporated into the spec.