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 30383 - [XSLT30] No description given of what happens when input-type-annotations="unspecified"
Summary: [XSLT30] No description given of what happens when input-type-annotations="un...
Status: NEW
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: 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: 2018-12-22 12:20 UTC by Abel Braaksma
Modified: 2019-02-19 20:00 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2018-12-22 12:20:38 UTC
It's unclear what action should be taken when input-type-annotations="unspecified". Is the behavior implementation-defined, does it mean that it is either "strip" or "preserve", or can it be a mix (that is, the processor only keeps what it thinks is useful, i.e. it can strip XSD 1.1 annotations if it can only deal with XSD 1.0 validation (not sure that would be useful))?

Or does it only mean "whatever is specified in another package or module"? But in that case, should the absence of *any* such attribute lead to "preserve" instead of a potentially destructive "strip"?

The term itself may seem explanatory enough but I couldn't make it out from the context alone (section 4.4.1).

Also, we don't explicitly say what happens if one package has "unspecified" and another "strip" (or preserver, but not both). I think in that case "unspecified" means "as specified elsewhere".
Comment 1 Michael Kay 2018-12-28 00:25:51 UTC
XSLT 2.0 included the sentence "Stripping of type annotations takes place if at least one stylesheet module in the stylesheet specifies input-type-annotations="strip"." which essentially fills this gap.

Basically if there's one module that says "strip":

* if there's also a module that says "preserve", it's an error

* otherwise (that is, if every other module specifies "strip", "unspecified", or nothing), then type annotations are stripped.

If there's no module that says "strip", then type annotations are preserved.

All ridiculously complicated, and could be stated a lot more clearly.
Comment 2 Michael Kay 2019-02-13 15:02:49 UTC
Drafted erratum E43 to say that (a) specifying input-type-annotations="unspecified" is equivalent to omitting the attribute. (b) If one module specifies "strip", type annotations are stripped.
Comment 3 Michael Kay 2019-02-18 12:13:57 UTC
Note that some of the problems with this section derive from poor application of the changes deemed necessary for bug #22733.
Comment 4 Abel Braaksma 2019-02-19 20:00:01 UTC
(In reply to Michael Kay from comment #1)
> All ridiculously complicated, and could be stated a lot more clearly.
Agreed that it is complicated ;). But I understand it now. "unspecified" is like a way of saying "please preserve, unless someone overrules with 'strip'", and just "preserve" cannot be overruled with "strip", it would cause an error.

For reference, the public HTML version of the erratum: https://htmlpreview.github.io/?https://github.com/w3c/qtspecs/blob/master/errata/xslt-30/html/xslt-30-errata.html#E43

> "The effect of specifying input-type-annotations="unspecified" is unspecified."
Brilliant! :D

On the proposed change (which I believe is clear): part of the text now mentions only xsl:package as scope for the attribute, other parts mention xsl:package/xsl:stylesheet/xsl:transform. Perhaps we could use this opportunity to unify this.