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 11913 - Description of windowing query 18 doesn't match the semantics of the query
Summary: Description of windowing query 18 doesn't match the semantics of the query
Status: RESOLVED DUPLICATE of bug 11762
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQuery 3.0 Use Cases (show other bugs)
Version: Working drafts
Hardware: PC All
: 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-01-28 21:15 UTC by Matthias Brantner
Modified: 2011-02-01 14:31 UTC (History)
1 user (show)

See Also:


Attachments

Description Matthias Brantner 2011-01-28 21:15:09 UTC
The textual description of windowing query q18 (see 4.2.18) says "Calculate the time needed to process an order from the request up to the shipping.".

However, in the query "and" has a higher priority than "or". Hence, any ShipNotice element is sufficient to end the window. I suggest to force precedence in the query as follows:

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

<result>{
  for sliding window $w in $seq/sequence/* 
    start  $s when $s[self::OrderRequest]
    end  $e when $e/@orderID eq  $s/@orderID
   and
   (
     $e[self::ConfirmationRequest] and $e/@status eq "reject" 
     or
    $e[self::ShipNotice]
    )
  where $e[self::ShipNotice]
  return 
    <timeToShip orderID="{ $s/@orderID}">{xs:dateTime($e/@date) - xs:dateTime($s/@date) }</timeToShip> 
}</result>
Comment 1 Matthias Brantner 2011-02-01 14:31:16 UTC
Closing as duplicate of bug #11762

*** This bug has been marked as a duplicate of bug 11762 ***