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 28933 - [XT30] Change the default for assertions to be OFF
Summary: [XT30] Change the default for assertions to be OFF
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XSLT 3.0 (show other bugs)
Version: Last Call drafts
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: 2015-07-09 16:53 UTC by Abel Braaksma
Modified: 2015-10-29 12:42 UTC (History)
0 users

See Also:


Attachments

Description Abel Braaksma 2015-07-09 16:53:19 UTC
As discussed by mail (see https://lists.w3.org/Archives/Member/w3c-xsl-wg/2015Jun/0012.html, member only) and agreed in the XSLWG meeting of July 9, 2015.

The default for assertions should be OFF instead of ON (current status quo).
Comment 1 Michael Kay 2015-07-09 23:11:45 UTC
Note, this change means it is no longer possible to control assertion enablement in this kind of way:

<xsl:variable name="ASSERTIONS_ON" select="true()" static="true"/>

<xsl:assert test="2=2" use-when="$ASSERTIONS_ON"/>
Comment 2 Abel Braaksma 2015-07-10 13:18:04 UTC
(In reply to Michael Kay from comment #1)
> Note, this change means it is no longer possible to control assertion
> enablement in this kind of way:
> 
> <xsl:variable name="ASSERTIONS_ON" select="true()" static="true"/>
> 
> <xsl:assert test="2=2" use-when="$ASSERTIONS_ON"/>

Interesting. But I have always found it extremely cumbersome to have the requirement to switch assertions on/off by having to use use-when on each and every xsl:assert, which kind-of violates the whole idea behind assertions as being a light-weight simple and quick approach to asserting your code.

Your code suggests the requirement or wish to be able to switch assertions on/off in the stylesheet, which, on the WG meeting was considered a non-necessity. 

Which brings us back to the idea of having an enable-assertions as a global attribute on xsl:stylesheet and xsl:package, with scope to the current package. I'm still somewhat silently rooting for it ;).
Comment 3 Abel Braaksma 2015-07-14 04:04:00 UTC
For reference, the proposal in comment#0 was accepted during XSLWG telcon of July 9, 2015, see https://lists.w3.org/Archives/Member/w3c-xsl-wg/2015Jul/0017.html (member only).