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 6093 - [XSLT 2.0] Incorrect inline schema example
Summary: [XSLT 2.0] Incorrect inline schema example
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 2.0 (show other bugs)
Version: Recommendation
Hardware: PC Windows NT
: P2 minor
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: 2008-09-18 14:25 UTC by Michael Kay
Modified: 2008-10-02 16:46 UTC (History)
0 users

See Also:


Attachments

Description Michael Kay 2008-09-18 14:25:41 UTC
Ken Holman has pointed out in private email that the example in section 3.14 is incorrect:

<xs:variable name="condition" select="'yes'" as="local:yes-no"/>

It should read

<xs:variable name="condition" select="local:yes-no('yes')" as="local:yes-no"/>

Because declaring the type of a variable does not by itself force a cast to that type.
Comment 1 Michael Kay 2008-09-18 14:37:27 UTC
> declaring the type of a variable does not by itself force a cast to that type.

Which raises the question, as an enhancement suggestion, whether this rule really improves the usability of the language.

What adverse consequences would follow if the XPath function conversion rules were changed so that if the required type is derived by restriction from the supplied type, an implicit cast takes place?
Comment 2 Michael Kay 2008-09-28 10:21:40 UTC
Erratum E28 has been created to correct this error.