W3C home > Mailing lists > Public > public-qt-comments@w3.org > November 2015

[Bug 29314] New: [FO31] Code example in http://www.w3.org/TR/xpath-functions-31/#func-random-number-generator does not work

From: <bugzilla@jessica.w3.org>
Date: Sun, 29 Nov 2015 18:30:41 +0000
To: public-qt-comments@w3.org
Message-ID: <bug-29314-523@http.www.w3.org/Bugs/Public/>
https://www.w3.org/Bugs/Public/show_bug.cgi?id=29314

            Bug ID: 29314
           Summary: [FO31] Code example in
                    http://www.w3.org/TR/xpath-functions-31/#func-random-n
                    umber-generator does not work
           Product: XPath / XQuery / XSLT
           Version: Candidate Recommendation
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Functions and Operators 3.1
          Assignee: mike@saxonica.com
          Reporter: martin.honnen@gmx.de
        QA Contact: public-qt-comments@w3.org
  Target Milestone: ---

I have tried the code example given in
http://www.w3.org/TR/xpath-functions-31/#func-random-number-generator, it has
the code 

declare %public function r:random-sequence($length as xs:integer) as xs:double*
{
  r:random-sequence($length, fn:random-number-generator())
};
declare %private function r:random-sequence($length as xs:integer, $G as
map(xs:string, item())) {
  if ($length eq 0)
  then ()
  else ($G?number, r:random-sequence($length - 1, $G?next())
};


The is a closing `)` missing in the `else` clause, should be

declare %public function r:random-sequence($length as xs:integer) as xs:double*
{
  r:random-sequence($length, fn:random-number-generator())
};
declare %private function r:random-sequence($length as xs:integer, $G as
map(xs:string, item())) {
  if ($length eq 0)
  then ()
  else ($G?number, r:random-sequence($length - 1, $G?next()))
};

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
Received on Sunday, 29 November 2015 18:30:43 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 29 November 2015 18:30:44 UTC