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 30236 - [XSLT30] (editorial) Example on static type error detection in function conversion rules assumes string -> date are coercible types, but they aren't, they are castable
Summary: [XSLT30] (editorial) Example on static type error detection in function conve...
Status: RESOLVED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 trivial
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-03-28 23:23 UTC by Abel Braaksma
Modified: 2019-02-20 00:25 UTC (History)
0 users

See Also:


Attachments
Screenshot of the Note in question on type errors (21.68 KB, image/png)
2018-03-28 23:25 UTC, Abel Braaksma
Details

Description Abel Braaksma 2018-03-28 23:23:47 UTC
In section 5.2 Expressions, the section describes the Function Conversion Rules as used, for instance, with the as-clause of xsl:variable.

A Note explains the difference between dynamic and static detection of type errors, and uses an example of a string value with 29 Feb, which cannot be xs:date because of its *value*, not its type.

However, a string can never be coerced into an xs:date. Perhaps the intention was a literal xs:untypedAtomic, or the untyped string value of an attribute or node.

The example in the Note is:

"Attempting to convert the string 2003-02-29 to a date is a dynamic error rather than a type error, because the problem is with this particular value, not with its type."

Note that the statement is not entirely false: a processor is not required to detect this statically, but this Note is specifically about statically detectable type errors, which this is (string can be cast to date, though, but that's a different subject).
Comment 1 Abel Braaksma 2018-03-28 23:25:21 UTC
Created attachment 1689 [details]
Screenshot of the Note in question on type errors
Comment 2 Abel Braaksma 2019-02-19 21:15:03 UTC
A proposed erratum E21 was published on 13 Feb 2019, HTML version: https://htmlpreview.github.io/?https://github.com/w3c/qtspecs/blob/master/errata/xslt-30/html/xslt-30-errata.html#E21

I think this erratum covers it.