<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>9532</bug_id>
          
          <creation_ts>2010-04-15 20:39:15 +0000</creation_ts>
          <short_desc>Invalid example in section B.3.</short_desc>
          <delta_ts>2010-05-13 21:00:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>Scripting Extensions 3.0</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Nikolay Ognyanov">nikolay.ognyanov</reporter>
          <assigned_to name="John Snelson">john.snelson</assigned_to>
          <cc>jim.melton</cc>
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>35077</commentid>
    <comment_count>0</comment_count>
    <who name="Nikolay Ognyanov">nikolay.ognyanov</who>
    <bug_when>2010-04-15 20:39:15 +0000</bug_when>
    <thetext>The example in section B.3.1. is apparently meant to be

let $uid := doc(&quot;users.xml&quot;)/users/user_tuple[name = &quot;Roger Smith&quot;]/userid
let $topbid := max(doc(&quot;bids.xml&quot;)/bids/bid_tuple[itemno = 1007]/bid)
let $newbid := $topbid * 1.1
return
  if($newbid &lt;= 240) then block {
    insert nodes
      &lt;bid_tuple&gt;
        &lt;userid&gt;{ data($uid) }&lt;/userid&gt;
        &lt;itemno&gt;1002&lt;/itemno&gt;
        &lt;bid&gt;{ $newbid }&lt;/bid&gt;
        &lt;bid_date&gt;1999-03-03&lt;/bid_date&gt;
      &lt;/bid_tuple&gt;
    into doc(&quot;bids.xml&quot;)/bids;
    exit returning &lt;new_bid&gt;{ $newbid }&lt;/new_bid&gt;;
  } else block {
    exit returning &lt;top_bid&gt;{ $topbid }&lt;/top_bid&gt;;
  }

but is missing &quot;block&quot; in front of blocks.

Transformed representation in B.3.3. is also missing the &apos;;&apos; terminator at the end of apply expressions.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35151</commentid>
    <comment_count>1</comment_count>
    <who name="John Snelson">john.snelson</who>
    <bug_when>2010-04-19 22:35:43 +0000</bug_when>
    <thetext>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</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35660</commentid>
    <comment_count>2</comment_count>
    <who name="Jim Melton">jim.melton</who>
    <bug_when>2010-05-13 01:06:21 +0000</bug_when>
    <thetext>Thanks for this report.  The example in B.3.1 is indeed missing the now-required keyword &quot;block&quot; preceding the open brace &quot;{&quot; of a block.  That will be fixed in the next publication of the XQuery Scripting Extension spec.  Although you didn&apos;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 &quot;;&quot; following the two &quot;apply expressions&quot; in the &apos;then&apos; branch of the &apos;if&apos;.  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&apos;ve made, I&apos;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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>35683</commentid>
    <comment_count>3</comment_count>
    <who name="Nikolay Ognyanov">nikolay.ognyanov</who>
    <bug_when>2010-05-13 21:00:58 +0000</bug_when>
    <thetext>Thank you.

Regards
Nikolay</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>