This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The query in Q18 is 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> The end condition requires additional parens: 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> The same issue occurs in Q19. It current reads: declare variable $seq := fn:doc("cxml.xml"); <result>{ for sliding window $w in $seq/sequence/* start previous $wSPrev when $wSPrev[self::OrderRequest] end next $wENext when $wENext/@orderID eq $wSPrev/@orderID and ( $wENext[self::ConfirmationRequest] and $wENext/@status eq "reject") or $wENext[self::ShipNotice] where $wENext[self::ShipNotice] return <bundleWith orderId="{$wSPrev/@orderID}">{ for sliding window $bundle in $w start $bSCur when $bSCur[self::OrderRequest] and $bSCur/@shipTo eq $wSPrev/@shipTo end $bECur next $bENext when $bECur/@orderID eq $bSCur/@orderID and ($bECur[self::ConfirmationRequest] and $bECur/@status eq "reject") or $bECur[self::ShipNotice] where empty($bENext) return $bSCur }</bundleWith> }</result> In both end conditions, additional parens are needed: declare variable $seq := fn:doc("cxml.xml"); <result>{ for sliding window $w in $seq/sequence/* start previous $wSPrev when $wSPrev[self::OrderRequest] end next $wENext when $wENext/@orderID eq $wSPrev/@orderID and ( ( $wENext[self::ConfirmationRequest] and $wENext/@status eq "reject") or $wENext[self::ShipNotice] ) where $wENext[self::ShipNotice] return <bundleWith orderId="{$wSPrev/@orderID}">{ for sliding window $bundle in $w start $bSCur when $bSCur[self::OrderRequest] and $bSCur/@shipTo eq $wSPrev/@shipTo end $bECur next $bENext when $bECur/@orderID eq $bSCur/@orderID and ( ($bECur[self::ConfirmationRequest] and $bECur/@status eq "reject") or $bECur[self::ShipNotice] ) where empty($bENext) return $bSCur }</bundleWith> }</result>
*** Bug 11913 has been marked as a duplicate of this bug. ***
*** Bug 11929 has been marked as a duplicate of this bug. ***