This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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.
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.