[Bug 11913] New: Description of windowing query 18 doesn't match the semantics of the query

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11913

           Summary: Description of windowing query 18 doesn't match the
                    semantics of the query
           Product: XPath / XQuery / XSLT
           Version: Working drafts
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XQuery 3.0 Use Cases
        AssignedTo: jonathan.robie@redhat.com
        ReportedBy: matthias.brantner@28msec.com
         QAContact: public-qt-comments@w3.org


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>

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 28 January 2011 21:15:12 UTC