This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The example in section B.3.1. is apparently meant to be let $uid := doc("users.xml")/users/user_tuple[name = "Roger Smith"]/userid let $topbid := max(doc("bids.xml")/bids/bid_tuple[itemno = 1007]/bid) let $newbid := $topbid * 1.1 return if($newbid <= 240) then block { insert nodes <bid_tuple> <userid>{ data($uid) }</userid> <itemno>1002</itemno> <bid>{ $newbid }</bid> <bid_date>1999-03-03</bid_date> </bid_tuple> into doc("bids.xml")/bids; exit returning <new_bid>{ $newbid }</new_bid>; } else block { exit returning <top_bid>{ $topbid }</top_bid>; } but is missing "block" in front of blocks. Transformed representation in B.3.3. is also missing the ';' terminator at the end of apply expressions.
I can confirm this error, which appears in the XQueryX appendix: http://www.w3.org/TR/2010/WD-xquery-sx-10-20100408/#id-xqsx-xqueryx-xq-rep
Thanks for this report. The example in B.3.1 is indeed missing the now-required keyword "block" preceding the open brace "{" of a block. That will be fixed in the next publication of the XQuery Scripting Extension spec. Although you didn't mention it, the omission also occurs in the generated XQuery text in B.3.3; that omission will also be corrected in the next publication. The transformed representation in B.3.3 is, as you point out, missing the ";" following the two "apply expressions" in the 'then' branch of the 'if'. Research into why they were missing revealed a couple of subtle bugs in the XML schema and the stylesheet, which will also be corrected in the next publication. Based on the corrections I've made, I've marked this bug as RESOLVED/FIXED. If you trust my statement that the change has been made, please mark the bug as CLOSED. If not, then try to remember to mark it CLOSED when we do publish the next draft of the XQuery Scripting Extension document and you can confirm the fixes.
Thank you. Regards Nikolay