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 29111 - Incorrect example in section 3.5.3.1: default case
Summary: Incorrect example in section 3.5.3.1: default case
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.1 Requirements and Use Cases (show other bugs)
Version: Working drafts
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Jonathan Robie
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-04 13:22 UTC by O'Neil Delpratt
Modified: 2015-10-09 08:35 UTC (History)
0 users

See Also:


Attachments

Description O'Neil Delpratt 2015-09-04 13:22:07 UTC
The example in section 3.5.3.1 incorrectly has the keyword 'case' after 'default'. See below:

declare function local:play(
  $secret-number as xs:integer,
  $guessed-number as xs:integer,
  $translator as function(xs:string) as xs:string)
{
  switch (true())
  case $guessed-number eq $secret-number
    return $translator("You won!")
  case $guessed-number lt $secret-number
    return $translator("The secret number is greater.")
  default case (: $guessed-number gt $secret-number :)
    return $translator("The secret number is lower.")
};
Comment 1 Jonathan Robie 2015-10-08 21:55:35 UTC
I just committed a fix.