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 12403 - [XQuery30UC] incorrect attribute name for "Windowing" Q12
Summary: [XQuery30UC] incorrect attribute name for "Windowing" Q12
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.0 Use Cases (show other bugs)
Version: Working drafts
Hardware: PC Windows XP
: 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: 2011-03-30 16:18 UTC by Andrew Eisenberg
Modified: 2011-04-25 19:57 UTC (History)
0 users

See Also:


Attachments

Description Andrew Eisenberg 2011-03-30 16:18:21 UTC
The query in Windowing Use Case Q12, 4.2.12 Q12, should produce a date attribute:

   return 
                <alert date="{...

The expected result contains a time attribute:

<alert time="2006-01-02T14:00:00-00:00">Clara is suspicious</alert>


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.
Comment 1 Jonathan Robie 2011-04-18 21:33:32 UTC
I believe this is correct now:

Solution in XQuery:

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

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

Expected Result:

<result>
  <alert time="2006-01-01T11:15:00Z">Anton and Barbara just arrived</alert>
</result>