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 29808 - [XSLT30] (editorial) xsl:use-package and using unnamed packages
Summary: [XSLT30] (editorial) xsl:use-package and using unnamed packages
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 editorial
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-05 03:13 UTC by Abel Braaksma
Modified: 2016-09-08 16:45 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2016-09-05 03:13:20 UTC
It is understandable that we disallow unnamed packages as library packages, but it is unclear what error should be raised. I suggest XTSE3000.

Under 3.5 Packages we say this:

"Unnamed packages are allowed, but they can only be used as the “top level” of an application; they cannot be the target of an xsl:use-package declaration in another package."

I couldn't find normatively whether this is illegal, though:

<xsl:use-package name="" version="*" />

Since an empty URI is also a legal (relative) URI, and we only say in the text that the name must be codepoint-equal, it would work that this actually loads an unnamed package (which would then subsequently fail because of the rule in 3.5).

I don't think we intend to allow this to happen. I suggest therefore an editorial clarification, for instance on the xsl:use-package/@name attribute, which can then consequently specify the error we would like to assign.

For instance, we could replace this:

"The used package must have a name that is an exact match for the name in the name attribute (using codepoint comparison), and its explicit or implicit package-version must match the version range given in the package-version attribute."

With something like this (added sentences):

"The used package must have a name that is an exact match for the name in the name attribute (using codepoint comparison), and its explicit or implicit package-version must match the version range given in the package-version attribute. If the value of the name attribute is the empty string, or exists entirely of whitespace, it designates the unnamed package. However, the empty package may only appear as top-level package: err:XTSE3000."
Comment 1 Abel Braaksma 2016-09-05 12:24:16 UTC
(also editorial) 

I just noticed that we should probably mention that leading and trailing whitespace are removed. I.e., these should be equal:

<xsl:use-package name="urn:test" />
<xsl:use-package name="   urn:test   " />
Comment 2 Michael Kay 2016-09-05 15:44:25 UTC
Re comment 1, we have a general statement in 2.2:

Except where the set of allowed values of an attribute is specified using the italicized name string or char, leading and trailing whitespace in the attribute value is ignored. In the case of an attribute value template, this applies to the effective value obtained when the attribute value template is expanded.
Comment 3 Michael Kay 2016-09-07 22:49:05 UTC
We say under xsl:package that the name attribute if present must be an absolute URI.

We say under xsl:use-package that the name of the package must be an exact match for the value of xsl:use-package/@name using codepoint comparison.

That cannot be the case if the package has no name. There is no suggestion anywhere that an unnamed package has a name equal to "".

Frankly, I think there is no problem here that needs fixing.
Comment 4 Abel Braaksma 2016-09-08 08:26:41 UTC
I think you are right. We use the term "unnamed package" and I read that somehow as meaning a package with a name equal to the empty string.

But that cannot be right. Either the name is *absent*, or the name is (possibly?) something compiler generated. Either way, it cannot be referenced, per your explanation in comment#3.

That, with your comment#2, leads me to conclude we should close this one as INVALID.
Comment 5 Abel Braaksma 2016-09-08 16:45:55 UTC
Closing as INVALID, as per today's telcon's decision.