<?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>12403</bug_id>
          
          <creation_ts>2011-03-30 16:18:21 +0000</creation_ts>
          <short_desc>[XQuery30UC] incorrect attribute name for &quot;Windowing&quot; Q12</short_desc>
          <delta_ts>2011-04-25 19:57:19 +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>XQuery 3.0 Use Cases</component>
          <version>Working drafts</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</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="Andrew Eisenberg">andrew.eisenberg</reporter>
          <assigned_to name="Jonathan Robie">jonathan.robie</assigned_to>
          
          
          <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>47056</commentid>
    <comment_count>0</comment_count>
    <who name="Andrew Eisenberg">andrew.eisenberg</who>
    <bug_when>2011-03-30 16:18:21 +0000</bug_when>
    <thetext>The query in Windowing Use Case Q12, 4.2.12 Q12, should produce a date attribute:

   return 
                &lt;alert date=&quot;{...

The expected result contains a time attribute:

&lt;alert time=&quot;2006-01-02T14:00:00-00:00&quot;&gt;Clara is suspicious&lt;/alert&gt;


I suggest that these be aligned by changing the attribute name in the query.

Note: The content of the alert element has already been corrected via Bug #11761.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47547</commentid>
    <comment_count>1</comment_count>
    <who name="Jonathan Robie">jonathan.robie</who>
    <bug_when>2011-04-18 21:33:32 +0000</bug_when>
    <thetext>I believe this is correct now:

Solution in XQuery:

declare variable $seq := fn:doc(&quot;person_events.xml&quot;);

&lt;result&gt;{
  for tumbling window $w in $seq/stream/event[direction eq &quot;in&quot;]
    start  $x when $x/person = (&quot;Barbara&quot;, &quot;Anton&quot;)
    end next $y when xs:dateTime($y/@time) - xs:dateTime($x/@time) gt xs:dayTimeDuration(&quot;PT30M&quot;)
  where $w[person eq &quot;Anton&quot;] and $w[person eq &quot;Barbara&quot;]
  return
    &lt;alert time=&quot;{ xs:dateTime($y/@time) }&quot;&gt;Anton and Barbara just arrived&lt;/alert&gt;
}&lt;/result&gt;

Expected Result:

&lt;result&gt;
  &lt;alert time=&quot;2006-01-01T11:15:00Z&quot;&gt;Anton and Barbara just arrived&lt;/alert&gt;
&lt;/result&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>