← Back to team overview

zorba-coders team mailing list archive

[Merge] lp:~zorba-coders/zorba/windowing-tests into lp:zorba

 

Matthias Brantner has proposed merging lp:~zorba-coders/zorba/windowing-tests into lp:zorba.

Requested reviews:
  Till Westmann (tillw)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/windowing-tests/+merge/97135

adapted tests to latest version of the use case document
-- 
https://code.launchpad.net/~zorba-coders/zorba/windowing-tests/+merge/97135
Your team Zorba Coders is subscribed to branch lp:zorba.
=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q10s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q10s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q10s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><alert date="2006-01-02Z">Barbara did not come to work</alert></result>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q11s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q11s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q11s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<results><result time="2006-01-01T11:15:00Z">Barbara</result><result time="2006-01-02T12:00:00Z"/><result time="2006-01-02T12:15:00Z">Clara</result><result time="2006-01-02T12:25:00Z">Clara</result><result time="2006-01-02T14:00:00Z"/></results>
\ No newline at end of file

=== modified file 'test/rbkt/ExpQueryResults/zorba/windowing/q12.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q12.xml.res	2011-01-24 11:43:14 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q12.xml.res	2012-03-13 03:02:21 +0000
@@ -1,1 +1,1 @@
-<result><alert date="2006-01-01T11:15:00Z">Anton and Barbara just arrived</alert></result>
+<result><alert time="2006-01-01T11:15:00Z">Anton and Barbara just arrived</alert></result>

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q12s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q12s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q12s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><alert time="2006-01-01T11:15:00Z">Anton and Barbara just arrived</alert></result>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q13s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q13s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q13s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><alert time="2006-01-02T14:00:00Z">Clara is suspicious</alert></result>
\ No newline at end of file

=== modified file 'test/rbkt/ExpQueryResults/zorba/windowing/q14.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q14.xml.res	2011-01-24 11:43:14 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q14.xml.res	2012-03-13 03:02:21 +0000
@@ -1,1 +1,1 @@
-<result><annoying-author><author xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>rokas@xxxxxxxxx</author></annoying-author></result>
+<result><annoying-author><author>rokas@xxxxxxxxx</author></annoying-author></result>

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q14s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q14s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q14s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><annoying-author><author>rokas@xxxxxxxxx</author></annoying-author></result>
\ No newline at end of file

=== modified file 'test/rbkt/ExpQueryResults/zorba/windowing/q15.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q15.xml.res	2011-01-24 11:43:14 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q15.xml.res	2012-03-13 03:02:21 +0000
@@ -1,1 +1,1 @@
-<result><item><date>2003-06-03</date><title xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Extending XQuery with Window Functions</title><title xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>XQueryP: A new programming language is born</title></item><item><date>2003-06-04</date></item></result>
+<result><item><date>2003-06-03</date><title>Extending XQuery with Window Functions</title><title>XQueryP: A new programming language is born</title></item><item><date>2003-06-04</date></item></result>

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q15s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q15s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q15s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><item><date>2003-06-03</date><title>Extending XQuery with Window Functions</title><title>XQueryP: A new programming language is born</title></item><item><date>2003-06-04</date></item></result>
\ No newline at end of file

=== modified file 'test/rbkt/ExpQueryResults/zorba/windowing/q16.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q16.xml.res	2011-01-24 11:43:14 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q16.xml.res	2012-03-13 03:02:21 +0000
@@ -1,1 +1,1 @@
-<result><item><date>2003-06-03</date><author name="rokas@xxxxxxxxx"><titles><title xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Why use cases are important Part 1.</title><title xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Why use cases are important Part 2.</title><title xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Why use cases are important Part 3.</title></titles></author><author name="tim@xxxxxxxxx"><titles><title xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Extending XQuery with Window Functions</title></titles></author><author name="david@xxxxxxxxx"><titles><title xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>XQueryP: A new programming language is born</title></titles></author></item><item><date>2003-06-04</date><author name="rokas@xxxxxxxxx"><titles><title xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Why use cases are annoying to write.</title></titles></author></item></result>
+<result><item><date>2003-06-03</date><author name="rokas@xxxxxxxxx"><titles><title>Why use cases are important Part 1.</title><title>Why use cases are important Part 2.</title><title>Why use cases are important Part 3.</title></titles></author><author name="tim@xxxxxxxxx"><titles><title>Extending XQuery with Window Functions</title></titles></author><author name="david@xxxxxxxxx"><titles><title>XQueryP: A new programming language is born</title></titles></author></item><item><date>2003-06-04</date><author name="rokas@xxxxxxxxx"><titles><title>Why use cases are annoying to write.</title></titles></author></item></result>

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q16s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q16s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q16s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><item><date>2003-06-03</date><author name="rokas@xxxxxxxxx"><titles><title>Why use cases are important Part 1.</title><title>Why use cases are important Part 2.</title><title>Why use cases are important Part 3.</title></titles></author><author name="tim@xxxxxxxxx"><titles><title>Extending XQuery with Window Functions</title></titles></author><author name="david@xxxxxxxxx"><titles><title>XQueryP: A new programming language is born</title></titles></author></item><item><date>2003-06-04</date><author name="rokas@xxxxxxxxx"><titles><title>Why use cases are annoying to write.</title></titles></author></item></result>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q17s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q17s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q17s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><mostValuableCustomer endOfDay="2006-01-01T00:00:00Z"><amount company="ACME1">1100</amount></mostValuableCustomer><mostValuableCustomer endOfDay="2006-01-02T00:00:00Z"><amount company="ACME1">10000</amount></mostValuableCustomer><mostValuableCustomer endOfDay="2006-01-03T00:00:00Z"/><mostValuableCustomer endOfDay="2006-01-04T00:00:00Z"/><mostValuableCustomer endOfDay="2006-01-05T00:00:00Z"/><mostValuableCustomer endOfDay="2006-01-06T00:00:00Z"><amount company="ACME2">100</amount></mostValuableCustomer><mostValuableCustomer endOfDay="2006-01-07T00:00:00Z"/></result>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q18s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q18s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q18s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><timeToShip orderID="OID01">P3DT22H</timeToShip><timeToShip orderID="OID03">P2DT19H</timeToShip></result>
\ No newline at end of file

=== modified file 'test/rbkt/ExpQueryResults/zorba/windowing/q19.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q19.xml.res	2011-01-25 10:11:46 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q19.xml.res	2012-03-13 03:02:21 +0000
@@ -1,12 +1,1 @@
-<result>
-  <bundleWith orderId="OID01">
-    <OrderRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
-                  billTo="ACME1"
-                  date="2006-01-02T14:00:00-00:00"
-                  orderID="OID03" shipTo="ACME1" total="10000" type="new">
-      <Item partID="ID3" quantity="100" unitPrice="100"/>
-    </OrderRequest>
-  </bundleWith>
-  <bundleWith orderId="OID02"/>
-  <bundleWith orderId="OID03"/>
-</result>
+<result><bundleWith orderId="OID01"><OrderRequest billTo="ACME1" date="2006-01-02T14:00:00-00:00" orderID="OID03" shipTo="ACME1" total="10000" type="new"><Item partID="ID3" quantity="100" unitPrice="100"></Item></OrderRequest></bundleWith></result>

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q19s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q19s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q19s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><bundleWith orderId="OID01"><OrderRequest billTo="ACME1" date="2006-01-02T14:00:00Z" orderID="OID03" shipTo="ACME1" total="10000" type="new"><Item partID="ID3" quantity="100" unitPrice="100"/></OrderRequest></bundleWith></result>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q1s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q1s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q1s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,1 @@
+<table><tr><td>Green</td><td>Pink</td><td>Lilac</td></tr><tr><td>Turquoise</td><td>Peach</td><td>Opal</td></tr><tr><td>Champagne</td></tr></table>

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q2s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q2s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q2s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter><section title="heading1"><para>para1</para><para>para2</para></section><section title="heading2"><para>para3</para><para>para4</para><para>para5</para></section></chapter>
\ No newline at end of file

=== modified file 'test/rbkt/ExpQueryResults/zorba/windowing/q3.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q3.xml.res	2011-01-24 11:43:14 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q3.xml.res	2012-03-13 03:02:21 +0000
@@ -1,1 +1,1 @@
-<doc><term><dt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>XML</dt><dd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Extensible Markup Language</dd></term><term><dt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>XSLT</dt><dt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>XSL Transformations</dt><dd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>A language for transforming XML</dd><dd xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>A specification produced by W3C</dd></term></doc>
+<doc><term><dt>XML</dt><dd>Extensible Markup Language</dd></term><term><dt>XSLT</dt><dt>XSL Transformations</dt><dd>A language for transforming XML</dd><dd>A specification produced by W3C</dd></term></doc>

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q3s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q3s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q3s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doc><term><dt>XML</dt><dd>Extensible Markup Language</dd></term><term><dt>XSLT</dt><dt>XSL Transformations</dt><dd>A language for transforming XML</dd><dd>A specification produced by W3C</dd></term></doc>
\ No newline at end of file

=== modified file 'test/rbkt/ExpQueryResults/zorba/windowing/q4.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q4.xml.res	2011-01-24 11:43:14 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q4.xml.res	2012-03-13 03:02:21 +0000
@@ -1,1 +1,1 @@
-8 9 17.333333333333332 18.666666666666668
+8 9 17 18

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q4s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q4s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q4s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+8 9 17 18
\ No newline at end of file

=== modified file 'test/rbkt/ExpQueryResults/zorba/windowing/q5.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q5.xml.res	2011-01-24 11:43:14 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q5.xml.res	2012-03-13 03:02:21 +0000
@@ -1,1 +1,1 @@
-8.88 8.68 12.52 15.6 24.72
+8.88 8.68 12.32 15.24 23.92

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q5s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q5s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q5s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+8.88 8.68 12.32 15.24 23.92
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q6s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q6s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q6s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<alarm>Outlier detected. Event id:5</alarm>
\ No newline at end of file

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q7s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q7s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q7s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><warning time="2006-01-01T11:00:00Z">Barbara: Anton arrived 1h ago</warning></result>
\ No newline at end of file

=== modified file 'test/rbkt/ExpQueryResults/zorba/windowing/q8.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q8.xml.res	2011-01-26 08:09:43 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q8.xml.res	2012-03-13 03:02:21 +0000
@@ -1,10 +1,1 @@
-<result>
-<working-time><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Anton</person><time>PT4H30M</time></working-time>
-<working-time><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Barbara</person><time>PT3H</time></working-time>
-<working-time><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Clara</person><time>PT1H</time></working-time>
-<working-time><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Anton</person><time>PT5H</time></working-time>
-<working-time><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Clara</person><time>PT10M</time></working-time>
-<working-time><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Clara</person><time>PT5M</time></working-time>
-<working-time><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Clara</person><time>PT15M</time></working-time>
-<working-time><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Clara</person><time>PT2H15M</time></working-time>
-</result>
+<result><working-time><person>Anton</person><time>PT4H30M</time></working-time><working-time><person>Barbara</person><time>PT3H</time></working-time><working-time><person>Clara</person><time>PT1H</time></working-time><working-time><person>Anton</person><time>PT5H</time></working-time><working-time><person>Clara</person><time>PT10M</time></working-time><working-time><person>Clara</person><time>PT5M</time></working-time><working-time><person>Clara</person><time>PT15M</time></working-time><working-time><person>Clara</person><time>PT2H15M</time></working-time></result>

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q8s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q8s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q8s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><working-time><person>Anton</person><time>PT4H30M</time></working-time><working-time><person>Barbara</person><time>PT3H</time></working-time><working-time><person>Clara</person><time>PT1H</time></working-time><working-time><person>Anton</person><time>PT5H</time></working-time><working-time><person>Clara</person><time>PT10M</time></working-time><working-time><person>Clara</person><time>PT5M</time></working-time><working-time><person>Clara</person><time>PT15M</time></working-time><working-time><person>Clara</person><time>PT2H15M</time></working-time></result>
\ No newline at end of file

=== modified file 'test/rbkt/ExpQueryResults/zorba/windowing/q9.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q9.xml.res	2011-01-24 11:43:14 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q9.xml.res	2012-03-13 03:02:21 +0000
@@ -1,1 +1,1 @@
-<result><working-time><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Barbara</person><time>PT3H</time></working-time><working-time><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Clara</person><time>PT3H45M</time></working-time><working-time><person xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>Anton</person><time>PT9H30M</time></working-time></result>
+<result><working-time><person>Barbara</person><time>PT3H</time></working-time><working-time><person>Clara</person><time>PT3H45M</time></working-time><working-time><person>Anton</person><time>PT9H30M</time></working-time></result>

=== added file 'test/rbkt/ExpQueryResults/zorba/windowing/q9s.xml.res'
--- test/rbkt/ExpQueryResults/zorba/windowing/q9s.xml.res	1970-01-01 00:00:00 +0000
+++ test/rbkt/ExpQueryResults/zorba/windowing/q9s.xml.res	2012-03-13 03:02:21 +0000
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<result><working-time>Anton<time>PT9H30M</time></working-time><working-time>Barbara<time>PT3H</time></working-time><working-time>Clara<time>PT3H45M</time></working-time></result>

=== modified file 'test/rbkt/Queries/CMakeLists.txt'
--- test/rbkt/Queries/CMakeLists.txt	2012-03-07 15:49:25 +0000
+++ test/rbkt/Queries/CMakeLists.txt	2012-03-13 03:02:21 +0000
@@ -546,3 +546,6 @@
 EXPECTED_FAILURE(test/rbkt/zorba/windowing/tumbling21 899364)
 
 
+# failing tests due to old group by syntax + semantics
+EXPECTED_FAILURE(test/rbkt/zorba/windowing/q9 924055)
+EXPECTED_FAILURE(test/rbkt/zorba/windowing/q9s 924055)

=== modified file 'test/rbkt/Queries/zorba/windowing/arrange_rows.xml'
--- test/rbkt/Queries/zorba/windowing/arrange_rows.xml	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/arrange_rows.xml	2012-03-13 03:02:21 +0000
@@ -1,4 +1,4 @@
-<doc xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="arrange_rows.xsd">
+<doc>
   <data>Green</data>
   <data>Pink</data>
   <data>Lilac</data>

=== added file 'test/rbkt/Queries/zorba/windowing/arrange_rows.xsd'
--- test/rbkt/Queries/zorba/windowing/arrange_rows.xsd	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/arrange_rows.xsd	2012-03-13 03:02:21 +0000
@@ -0,0 +1,9 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+    <xs:element name="doc">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="data" type="xs:string" maxOccurs="unbounded"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+</xs:schema>

=== modified file 'test/rbkt/Queries/zorba/windowing/cxml.xml'
--- test/rbkt/Queries/zorba/windowing/cxml.xml	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/cxml.xml	2012-03-13 03:02:21 +0000
@@ -1,4 +1,4 @@
-<sequence  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="cxml.xsd">
+<sequence>
   <time date="2006-01-01T00:00:00-00:00"/>
   <OrderRequest billTo="ACME1" date="2006-01-01T10:00:00-00:00"
     orderID="OID01" shipTo="ACME1" total="1100" type="new">

=== added file 'test/rbkt/Queries/zorba/windowing/cxml.xsd'
--- test/rbkt/Queries/zorba/windowing/cxml.xsd	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/cxml.xsd	2012-03-13 03:02:21 +0000
@@ -0,0 +1,44 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+    <xs:element name="sequence">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:choice maxOccurs="unbounded">
+                    <xs:element name="time" type="TimeEvent"/>
+                    <xs:element name="OrderRequest" type="OrderRequest" maxOccurs="unbounded"/>
+                    <xs:element name="ConfirmationRequest" type="ConfirmationRequest"/>
+                    <xs:element name="ShipNotice" type="ShipNotice" maxOccurs="unbounded"/>
+                </xs:choice>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    <xs:complexType name="TimeEvent">
+        <xs:attribute name="date" type="xs:dateTime" use="required"/>
+    </xs:complexType>
+    <xs:complexType name="OrderRequest">
+        <xs:sequence>
+            <xs:element name="Item" maxOccurs="unbounded">
+                <xs:complexType>
+                    <xs:attribute name="unitPrice" type="xs:byte" use="required"/>
+                    <xs:attribute name="quantity" type="xs:byte" use="required"/>
+                    <xs:attribute name="partID" type="xs:string" use="required"/>
+                </xs:complexType>
+            </xs:element>
+        </xs:sequence>
+        <xs:attribute name="type" type="xs:string" use="required"/>
+        <xs:attribute name="total" type="xs:short" use="required"/>
+        <xs:attribute name="shipTo" type="xs:string"/>
+        <xs:attribute name="orderID" type="xs:string" use="required"/>
+        <xs:attribute name="date" type="xs:dateTime" use="required"/>
+        <xs:attribute name="billTo" type="xs:string" use="required"/>
+    </xs:complexType>
+    <xs:complexType name="ConfirmationRequest">
+        <xs:attribute name="status" type="xs:string" use="required"/>
+        <xs:attribute name="orderID" type="xs:string" use="required"/>
+        <xs:attribute name="date" type="xs:dateTime" use="required"/>
+        <xs:attribute name="confirmID" type="xs:string" use="required"/>
+    </xs:complexType>
+    <xs:complexType name="ShipNotice">
+        <xs:attribute name="orderID" type="xs:string" use="required"/>
+        <xs:attribute name="date" type="xs:dateTime" use="required"/>
+    </xs:complexType>
+</xs:schema>

=== added file 'test/rbkt/Queries/zorba/windowing/head_para.xsd'
--- test/rbkt/Queries/zorba/windowing/head_para.xsd	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/head_para.xsd	2012-03-13 03:02:21 +0000
@@ -0,0 +1,12 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+    <xs:element name="body">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:sequence maxOccurs="unbounded">
+                    <xs:element name="h2" type="xs:string"/>
+                    <xs:element name="p" type="xs:string" maxOccurs="unbounded"/>
+                </xs:sequence>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+</xs:schema>

=== modified file 'test/rbkt/Queries/zorba/windowing/person_events.xml'
--- test/rbkt/Queries/zorba/windowing/person_events.xml	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/person_events.xml	2012-03-13 03:02:21 +0000
@@ -1,5 +1,4 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<stream xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="person_events.xsd">
+<stream>
   <event time="2006-01-01T01:00:00-00:00"/>
   <event time="2006-01-01T10:30:00-00:00">
     <person>Anton</person>

=== added file 'test/rbkt/Queries/zorba/windowing/person_events.xsd'
--- test/rbkt/Queries/zorba/windowing/person_events.xsd	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/person_events.xsd	2012-03-13 03:02:21 +0000
@@ -0,0 +1,17 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+    <xs:element name="stream">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="event" maxOccurs="unbounded">
+                    <xs:complexType>
+                        <xs:sequence minOccurs="0">
+                            <xs:element name="person" type="xs:string"/>
+                            <xs:element name="direction" type="xs:string"/>
+                        </xs:sequence>
+                        <xs:attribute name="time" type="xs:dateTime" use="required"/>
+                    </xs:complexType>
+                </xs:element>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+</xs:schema>

=== modified file 'test/rbkt/Queries/zorba/windowing/q1.xq'
--- test/rbkt/Queries/zorba/windowing/q1.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q1.xq	2012-03-13 03:02:21 +0000
@@ -2,7 +2,7 @@
 
 <table>{
   for tumbling window $w in $seq/doc/*
-    start at $x when fn:true() 
+    start at $x when fn:true()
     end at $y when $y - $x = 2
   return
     <tr>{

=== modified file 'test/rbkt/Queries/zorba/windowing/q10.xq'
--- test/rbkt/Queries/zorba/windowing/q10.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q10.xq	2012-03-13 03:02:21 +0000
@@ -2,8 +2,8 @@
 
 <result>{
   for tumbling window $w in $seq/stream/event[direction eq "in"]
-    start  $s when fn:true() 
-    end next $e when xs:date( xs:dateTime($s/@time) ) ne xs:date( xs:dateTime($e/@time) ) 
+    start  $s when fn:true()
+    end next $e when xs:date( xs:dateTime($s/@time) ) ne xs:date( xs:dateTime($e/@time) )
   let $date := xs:date(xs:dateTime($s/@time))
   where not($w[person eq "Barbara"])
   return <alert date="{ $date }">Barbara did not come to work</alert>

=== added file 'test/rbkt/Queries/zorba/windowing/q10s.xq'
--- test/rbkt/Queries/zorba/windowing/q10s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q10s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,12 @@
+import schema default element namespace "" at "person_events.xsd";
+
+declare variable $seq := validate { fn:doc("person_events.xml") };
+
+<result>{
+  for tumbling window $w in $seq/stream/event[direction eq "in"]
+    start  $s when fn:true()
+    end next $e when xs:date( xs:dateTime($s/@time) ) ne xs:date( xs:dateTime($e/@time) )
+  let $date := xs:date(xs:dateTime($s/@time))
+  where not($w[person eq "Barbara"])
+  return <alert date="{ $date }">Barbara did not come to work</alert>
+}</result>

=== modified file 'test/rbkt/Queries/zorba/windowing/q11.xq'
--- test/rbkt/Queries/zorba/windowing/q11.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q11.xq	2012-03-13 03:02:21 +0000
@@ -4,9 +4,9 @@
   for tumbling window $w in $seq/stream/event[direction eq "in"]
     start when true()
     only end next $x when  $x/person eq "Clara"
-  return 
+  return
     <result time="{ $x/@time }">{
-      distinct-values(for $y in $w 
+      distinct-values(for $y in $w
         where (xs:dateTime($y/@time) + xs:dayTimeDuration("PT15M") ) ge xs:dateTime($x/@time)
         return $y/person)
     }</result>

=== added file 'test/rbkt/Queries/zorba/windowing/q11s.xq'
--- test/rbkt/Queries/zorba/windowing/q11s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q11s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,15 @@
+import schema default element namespace "" at "person_events.xsd";
+
+declare variable $seq := validate { fn:doc("person_events.xml") };
+
+<results>{
+  for tumbling window $w in $seq/stream/event[direction eq "in"]
+    start when true()
+    only end next $x when  $x/person eq "Clara"
+  return
+    <result time="{ $x/@time }">{
+      distinct-values(for $y in $w
+        where (xs:dateTime($y/@time) + xs:dayTimeDuration("PT15M") ) ge xs:dateTime($x/@time)
+        return $y/person)
+    }</result>
+}</results>

=== modified file 'test/rbkt/Queries/zorba/windowing/q12.xq'
--- test/rbkt/Queries/zorba/windowing/q12.xq	2011-01-26 08:09:43 +0000
+++ test/rbkt/Queries/zorba/windowing/q12.xq	2012-03-13 03:02:21 +0000
@@ -1,12 +1,10 @@
 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 date="{ xs:dateTime($y/@time) }">Anton and Barbara just arrived</alert>
-}
-</result>
+<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>

=== added file 'test/rbkt/Queries/zorba/windowing/q12s.xq'
--- test/rbkt/Queries/zorba/windowing/q12s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q12s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,12 @@
+import schema default element namespace "" at "person_events.xsd";
+
+declare variable $seq := validate { 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>

=== modified file 'test/rbkt/Queries/zorba/windowing/q13.xq'
--- test/rbkt/Queries/zorba/windowing/q13.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q13.xq	2012-03-13 03:02:21 +0000
@@ -1,11 +1,11 @@
 declare variable $seq := fn:doc("person_events.xml");
 
 <result>{
-  for sliding window $w in $seq/stream/event 
-    start  $s when true() 
-    end next $e when xs:dateTime($e/@time) - xs:dateTime($s/@time) gt 
+  for sliding window $w in $seq/stream/event
+    start  $s when true()
+    end next $e when xs:dateTime($e/@time) - xs:dateTime($s/@time) gt
       xs:dayTimeDuration("PT1H")
   where count($w[person eq $s/person and direction eq "in"]) ge 3
-  return 
+  return
     <alert time="{ $e/@time }">{fn:data($s/person)} is suspicious</alert>
 }</result>

=== added file 'test/rbkt/Queries/zorba/windowing/q13s.xq'
--- test/rbkt/Queries/zorba/windowing/q13s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q13s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,13 @@
+import schema default element namespace "" at "person_events.xsd";
+
+declare variable $seq := validate { fn:doc("person_events.xml") };
+
+<result>{
+  for sliding window $w in $seq/stream/event
+    start  $s when true()
+    end next $e when xs:dateTime($e/@time) - xs:dateTime($s/@time) gt
+      xs:dayTimeDuration("PT1H")
+  where count($w[person eq $s/person and direction eq "in"]) ge 3
+  return
+    <alert time="{ $e/@time }">{fn:data($s/person)} is suspicious</alert>
+}</result>

=== modified file 'test/rbkt/Queries/zorba/windowing/q14.xq'
--- test/rbkt/Queries/zorba/windowing/q14.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q14.xq	2012-03-13 03:02:21 +0000
@@ -1,7 +1,7 @@
 declare variable $rssfeed := fn:doc("rss.xml");
 
 <result>{
-  for tumbling window $w in $rssfeed/rss/channel/item 
+  for tumbling window $w in $rssfeed/rss/channel/item
     start  $first when fn:true()
     end next $lookAhead when $first/author ne $lookAhead/author
   where count($w) ge 3

=== added file 'test/rbkt/Queries/zorba/windowing/q14s.xq'
--- test/rbkt/Queries/zorba/windowing/q14s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q14s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,13 @@
+import schema default element namespace "" at "rss.xsd";
+
+declare variable $rssfeed := validate { fn:doc("rss.xml") };
+
+<result>{
+  for tumbling window $w in $rssfeed/rss/channel/item
+    start  $first when fn:true()
+    end next $lookAhead when $first/author ne $lookAhead/author
+  where count($w) ge 3
+  return <annoying-author>{
+      $w[1]/author
+    }</annoying-author>
+}</result>

=== modified file 'test/rbkt/Queries/zorba/windowing/q15.xq'
--- test/rbkt/Queries/zorba/windowing/q15.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q15.xq	2012-03-13 03:02:21 +0000
@@ -1,16 +1,15 @@
-
 declare variable $rssfeed := fn:doc("rss.xml");
 
 <result>{
-  for tumbling window $w in $rssfeed/rss/channel/item 
+  for tumbling window $w in $rssfeed/rss/channel/item
     start  $s_curr when true()
-    end next $e_next when 
-      fn:day-from-dateTime(xs:dateTime($e_next/pubDate)) ne 
+    end next $e_next when
+      fn:day-from-dateTime(xs:dateTime($e_next/pubDate)) ne
       fn:day-from-dateTime(xs:dateTime($s_curr/pubDate))
-  return 
+  return
     <item>
         <date>{xs:date(xs:dateTime($s_curr/pubDate))}</date>
-        {  for $item in $w 
+        {  for $item in $w
                    where fn:contains( xs:string($item/title), 'XQuery')
                    return $item/title   }
       </item>

=== added file 'test/rbkt/Queries/zorba/windowing/q15s.xq'
--- test/rbkt/Queries/zorba/windowing/q15s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q15s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,18 @@
+import schema default element namespace "" at "rss.xsd";
+
+declare variable $rssfeed := validate { fn:doc("rss.xml") };
+
+<result>{
+  for tumbling window $w in $rssfeed/rss/channel/item
+    start  $s_curr when true()
+    end next $e_next when
+      fn:day-from-dateTime(xs:dateTime($e_next/pubDate)) ne
+      fn:day-from-dateTime(xs:dateTime($s_curr/pubDate))
+  return
+    <item>
+        <date>{xs:date(xs:dateTime($s_curr/pubDate))}</date>
+        {  for $item in $w
+                   where fn:contains( xs:string($item/title), 'XQuery')
+                   return $item/title   }
+      </item>
+}</result>

=== modified file 'test/rbkt/Queries/zorba/windowing/q16.xq'
--- test/rbkt/Queries/zorba/windowing/q16.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q16.xq	2012-03-13 03:02:21 +0000
@@ -1,16 +1,16 @@
 declare variable $rssfeed := fn:doc("rss.xml");
 
 <result>{
-  for tumbling window $w in $rssfeed/rss/channel/item 
+  for tumbling window $w in $rssfeed/rss/channel/item
     start  $s_curr when true()
-    end next $e_next when 
-      fn:day-from-dateTime(xs:dateTime($e_next/pubDate)) ne 
+    end next $e_next when
+      fn:day-from-dateTime(xs:dateTime($e_next/pubDate)) ne
       fn:day-from-dateTime(xs:dateTime($s_curr/pubDate))
-  return 
+  return
     <item>
       <date>{xs:date(xs:dateTime($s_curr/pubDate))}</date>
-       {  for $a in fn:distinct-values($w/author) 
-           return 
+       {  for $a in fn:distinct-values($w/author)
+           return
              <author name="{$a}">
                <titles>
                  { $w[author eq $a]/title }

=== added file 'test/rbkt/Queries/zorba/windowing/q16s.xq'
--- test/rbkt/Queries/zorba/windowing/q16s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q16s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,23 @@
+import schema default element namespace "" at "rss.xsd";
+
+declare variable $rssfeed := validate { fn:doc("rss.xml") };
+
+<result>{
+  for tumbling window $w in $rssfeed/rss/channel/item
+    start  $s_curr when true()
+    end next $e_next when
+      fn:day-from-dateTime(xs:dateTime($e_next/pubDate)) ne
+      fn:day-from-dateTime(xs:dateTime($s_curr/pubDate))
+  return
+    <item>
+      <date>{xs:date(xs:dateTime($s_curr/pubDate))}</date>
+       {  for $a in fn:distinct-values($w/author)
+           return
+             <author name="{$a}">
+               <titles>
+                 { $w[author eq $a]/title }
+               </titles>
+                        </author>
+            }
+          </item>
+}</result>

=== modified file 'test/rbkt/Queries/zorba/windowing/q17.xq'
--- test/rbkt/Queries/zorba/windowing/q17.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q17.xq	2012-03-13 03:02:21 +0000
@@ -1,17 +1,17 @@
 declare variable $seq := fn:doc("cxml.xml");
 
 <result>{
-for sliding window $w in $seq/sequence/* 
-  start  $cur previous $prev 
+for sliding window $w in $seq/sequence/*
+  start  $cur previous $prev
    when day-from-dateTime($cur/@date) ne day-from-dateTime($prev/@date) or empty($prev)
   end $end next $next
    when day-from-dateTime(xs:dateTime($end/@date)) ne
 day-from-dateTime(xs:dateTime($next/@date))
 return
   <mostValuableCustomer endOfDay="{xs:dateTime($cur/@date)}">{
-    let $companies :=   for $x in distinct-values($w/@billTo ) 
+    let $companies :=   for $x in distinct-values($w/@billTo )
                         return <amount company="{$x}">{sum($w[@billTo eq $x]/@total)}</amount>
-    let $max := max($companies) 
+    let $max := max($companies)
     for $company in $companies
     where $company eq xs:untypedAtomic($max)
     return $company

=== added file 'test/rbkt/Queries/zorba/windowing/q17s.xq'
--- test/rbkt/Queries/zorba/windowing/q17s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q17s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,21 @@
+import schema default element namespace "" at "cxml.xsd";
+
+declare variable $seq := validate { fn:doc("cxml.xml") };
+
+<result>{
+for sliding window $w in $seq/sequence/*
+  start  $cur previous $prev
+   when day-from-dateTime($cur/@date) ne day-from-dateTime($prev/@date) or empty($prev)
+  end $end next $next
+   when day-from-dateTime(xs:dateTime($end/@date)) ne
+day-from-dateTime(xs:dateTime($next/@date))
+return
+  <mostValuableCustomer endOfDay="{xs:dateTime($cur/@date)}">{
+    let $companies :=   for $x in distinct-values($w/@billTo )
+                        return <amount company="{$x}">{sum($w[@billTo eq $x]/@total)}</amount>
+    let $max := max($companies)
+    for $company in $companies
+    where $company eq xs:untypedAtomic($max)
+    return $company
+  }</mostValuableCustomer>
+}</result>

=== modified file 'test/rbkt/Queries/zorba/windowing/q18.xq'
--- test/rbkt/Queries/zorba/windowing/q18.xq	2011-02-01 15:56:40 +0000
+++ test/rbkt/Queries/zorba/windowing/q18.xq	2012-03-13 03:02:21 +0000
@@ -1,12 +1,12 @@
 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])
+  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> 
+  return
+    <timeToShip orderID="{ $s/@orderID}">{xs:dateTime($e/@date) - xs:dateTime($s/@date) }</timeToShip>
 }</result>

=== added file 'test/rbkt/Queries/zorba/windowing/q18s.xq'
--- test/rbkt/Queries/zorba/windowing/q18s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q18s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,14 @@
+import schema default element namespace "" at "cxml.xsd";
+
+declare variable $seq := validate { 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>

=== modified file 'test/rbkt/Queries/zorba/windowing/q19.xq'
--- test/rbkt/Queries/zorba/windowing/q19.xq	2011-01-25 10:11:46 +0000
+++ test/rbkt/Queries/zorba/windowing/q19.xq	2012-03-13 03:02:21 +0000
@@ -1,26 +1,22 @@
 declare variable $seq := fn:doc("cxml.xml");
 
-<result>
-{
-for sliding window $w in $seq/sequence/* 
+<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 
+    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]
+          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>
+    }</bundleWith>
+}</result>

=== added file 'test/rbkt/Queries/zorba/windowing/q19s.xq'
--- test/rbkt/Queries/zorba/windowing/q19s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q19s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,24 @@
+import schema default element namespace "" at "cxml.xsd";
+
+declare variable $seq := validate { 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>

=== added file 'test/rbkt/Queries/zorba/windowing/q1s.xq'
--- test/rbkt/Queries/zorba/windowing/q1s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q1s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,15 @@
+import schema default element namespace "" at "arrange_rows.xsd";
+
+declare variable $seq := validate { validate { fn:doc("arrange_rows.xml") } };
+
+<table>{
+  for tumbling window $w in $seq/doc/*
+    start at $x when fn:true()
+    end at $y when $y - $x = 2
+  return
+    <tr>{
+      for $i in $w
+      return
+        <td>{data($i)}</td>
+    }</tr>
+}</table>

=== modified file 'test/rbkt/Queries/zorba/windowing/q2.xq'
--- test/rbkt/Queries/zorba/windowing/q2.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q2.xq	2012-03-13 03:02:21 +0000
@@ -1,12 +1,12 @@
 declare variable $seq := fn:doc("head_para.xml");
 
 <chapter>{
-  for tumbling window $w in $seq/body/* 
-    start previous $s when $s[self::h2]  
-    end next $e when $e[self::h2] 
+  for tumbling window $w in $seq/body/*
+    start previous $s when $s[self::h2]
+    end next $e when $e[self::h2]
   return
     <section title="{data($s)}">{
-       for $x in $w 
+       for $x in $w
        return
          <para>{data($x)}</para>
   }</section>

=== added file 'test/rbkt/Queries/zorba/windowing/q2s.xq'
--- test/rbkt/Queries/zorba/windowing/q2s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q2s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,15 @@
+import schema default element namespace "" at "head_para.xsd";
+
+declare variable $seq := validate { fn:doc("head_para.xml") };
+
+<chapter>{
+  for tumbling window $w in $seq/body/*
+    start previous $s when $s[self::h2]
+    end next $e when $e[self::h2]
+  return
+    <section title="{data($s)}">{
+       for $x in $w
+       return
+         <para>{data($x)}</para>
+  }</section>
+}</chapter>

=== added file 'test/rbkt/Queries/zorba/windowing/q3s.xq'
--- test/rbkt/Queries/zorba/windowing/q3s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q3s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,13 @@
+import schema default element namespace "" at "term_def_list.xsd";
+
+declare variable $seq := validate { fn:doc("term_def_list.xml") };
+
+<doc>{
+for tumbling window $w in $seq/doc/*
+  start $x when $x[self::dt]
+  end $y next $z when $y[self::dd] and $z[self::dt]
+return
+  <term>{
+    $w
+  }</term>
+}</doc>

=== added file 'test/rbkt/Queries/zorba/windowing/q4s.xq'
--- test/rbkt/Queries/zorba/windowing/q4s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q4s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,13 @@
+import schema default element namespace "" at "temp_events.xsd";
+
+declare variable $timesequence := validate { fn:doc("temp_events.xml") };
+
+let $MAX_DIFF := 2
+
+for sliding window $w in $timesequence/stream/event 
+  start  $s_curr at $s_pos previous $s_prev
+    when ($s_curr/@time ne $s_prev/@time) or (empty($s_prev))
+  only end next $e_next 
+    when $e_next/@time - $s_curr/@time gt $MAX_DIFF
+return 
+  avg( $w/@temp )

=== modified file 'test/rbkt/Queries/zorba/windowing/q5.xq'
--- test/rbkt/Queries/zorba/windowing/q5.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q5.xq	2012-03-13 03:02:21 +0000
@@ -1,10 +1,11 @@
 declare variable $timesequence := fn:doc("temp_events.xml");
+
 let $SMOOTH_CONST := 0.2
 
 for sliding window $w in $timesequence/stream/event
   start at $s_pos when true()
   only end at $e_pos when $e_pos - $s_pos eq 2
-return 
+return
   round-half-to-even($SMOOTH_CONST * data($w[3]/@temp) + (1 - $SMOOTH_CONST) *
-    ( $SMOOTH_CONST * data($w[2]/@temp) + 
+    ( $SMOOTH_CONST * data($w[2]/@temp) +
       (1 - $SMOOTH_CONST) * data($w[1]/@temp) ), 2)

=== added file 'test/rbkt/Queries/zorba/windowing/q5s.xq'
--- test/rbkt/Queries/zorba/windowing/q5s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q5s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,13 @@
+import schema default element namespace "" at "temp_events.xsd";
+
+declare variable $timesequence := validate { fn:doc("temp_events.xml") };
+
+let $SMOOTH_CONST := 0.2
+
+for sliding window $w in $timesequence/stream/event
+  start at $s_pos when true()
+  only end at $e_pos when $e_pos - $s_pos eq 2
+return
+  round-half-to-even($SMOOTH_CONST * data($w[3]/@temp) + (1 - $SMOOTH_CONST) *
+    ( $SMOOTH_CONST * data($w[2]/@temp) +
+      (1 - $SMOOTH_CONST) * data($w[1]/@temp) ), 2)

=== modified file 'test/rbkt/Queries/zorba/windowing/q6.xq'
--- test/rbkt/Queries/zorba/windowing/q6.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q6.xq	2012-03-13 03:02:21 +0000
@@ -1,6 +1,6 @@
 declare variable $seq := fn:doc("temp_events.xml");
 
-for sliding window $w in $seq/stream/event 
+for sliding window $w in $seq/stream/event
   start  $s_curr when fn:true()
   only end next $next when $next/@time > $s_curr/@time + 3
 return

=== added file 'test/rbkt/Queries/zorba/windowing/q6s.xq'
--- test/rbkt/Queries/zorba/windowing/q6s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q6s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,11 @@
+import schema default element namespace "" at "temp_events.xsd";
+
+declare variable $seq := validate { fn:doc("temp_events.xml") };
+
+for sliding window $w in $seq/stream/event
+  start  $s_curr when fn:true()
+  only end next $next when $next/@time > $s_curr/@time + 3
+return
+  let $avg := fn:avg($w/@temp)
+  where $avg * 2 lt xs:double($next/@temp) or $avg div 2 gt xs:double($next/@temp)
+  return <alarm>Outlier detected. Event id:{data($next/@time)}</alarm>

=== modified file 'test/rbkt/Queries/zorba/windowing/q7.xq'
--- test/rbkt/Queries/zorba/windowing/q7.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q7.xq	2012-03-13 03:02:21 +0000
@@ -1,13 +1,13 @@
 declare variable $seq := fn:doc("person_events.xml");
 
 <result>{
-  for tumbling window $w in $seq/stream/event 
+  for tumbling window $w in $seq/stream/event
     start  $s when $s/person eq "Anton" and $s/direction eq "in"
-    only end $e next $n when  xs:dateTime($n/@time) - xs:dateTime($s/@time) gt 
-      xs:dayTimeDuration("PT1H") 
-      or  ($e/person eq "Barbara" and $e/direction eq "in") 
-      or ($e/person eq "Anton" and $e/direction eq "out") 
+    only end $e next $n when  xs:dateTime($n/@time) - xs:dateTime($s/@time) gt
+      xs:dayTimeDuration("PT1H")
+      or  ($e/person eq "Barbara" and $e/direction eq "in")
+      or ($e/person eq "Anton" and $e/direction eq "out")
   where $e/person eq "Barbara" and $e/direction eq "in"
-  return 
+  return
     <warning time="{ $e/@time }">Barbara: Anton arrived 1h ago</warning>
 }</result>

=== added file 'test/rbkt/Queries/zorba/windowing/q7s.xq'
--- test/rbkt/Queries/zorba/windowing/q7s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q7s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,15 @@
+import schema default element namespace "" at "person_events.xsd";
+
+declare variable $seq := validate { fn:doc("person_events.xml") };
+
+<result>{
+  for tumbling window $w in $seq/stream/event
+    start  $s when $s/person eq "Anton" and $s/direction eq "in"
+    only end $e next $n when  xs:dateTime($n/@time) - xs:dateTime($s/@time) gt
+      xs:dayTimeDuration("PT1H")
+      or  ($e/person eq "Barbara" and $e/direction eq "in")
+      or ($e/person eq "Anton" and $e/direction eq "out")
+  where $e/person eq "Barbara" and $e/direction eq "in"
+  return
+    <warning time="{ $e/@time }">Barbara: Anton arrived 1h ago</warning>
+}</result>

=== modified file 'test/rbkt/Queries/zorba/windowing/q8.xq'
--- test/rbkt/Queries/zorba/windowing/q8.xq	2011-01-25 10:11:46 +0000
+++ test/rbkt/Queries/zorba/windowing/q8.xq	2012-03-13 03:02:21 +0000
@@ -1,14 +1,13 @@
 declare variable $seq := fn:doc("person_events.xml");
 
-<result>
-{
+<result>{
 for sliding window $w in $seq/stream/event
-  start $s when $s/direction eq "in"
-  only end $e when $s/person eq $e/person and $e/direction eq "out"
+  start  $s when $s/direction eq "in"
+  only end  $e when $s/person eq $e/person and
+    $e/direction eq "out"
 return
-  <working-time> 
+  <working-time>
       {$s/person}
       <time>{ xs:dateTime($e/@time) - xs:dateTime($s/@time)}</time>
   </working-time>
-}
-</result>
+}</result>

=== added file 'test/rbkt/Queries/zorba/windowing/q8s.xq'
--- test/rbkt/Queries/zorba/windowing/q8s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q8s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,15 @@
+import schema default element namespace "" at "person_events.xsd";
+
+declare variable $seq := validate { fn:doc("person_events.xml") };
+
+<result>{
+for sliding window $w in $seq/stream/event
+  start  $s when $s/direction eq "in"
+  only end  $e when $s/person eq $e/person and
+    $e/direction eq "out"
+return
+  <working-time>
+      {$s/person}
+      <time>{ xs:dateTime($e/@time) - xs:dateTime($s/@time)}</time>
+  </working-time>
+}</result>

=== modified file 'test/rbkt/Queries/zorba/windowing/q9.xq'
--- test/rbkt/Queries/zorba/windowing/q9.xq	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/q9.xq	2012-03-13 03:02:21 +0000
@@ -1,16 +1,17 @@
 declare variable $seq := fn:doc("person_events.xml");
 
 <result>{
-for sliding window $w in $seq/stream/event 
+for sliding window $w in $seq/stream/event
   start  $s when $s/direction eq "in"
   only end  $e when $s/person eq $e/person and
     $e/direction eq "out"
 let $person := $s/person
 let $workingTime := xs:dateTime($e/@time) - xs:dateTime($s/@time)
 group by $person
+order by $person
 return
   <working-time>
-    {$person}
+    <person>{ $person }</person>
     <time>{ sum($workingTime) }</time>
   </working-time>
 }</result>

=== added file 'test/rbkt/Queries/zorba/windowing/q9s.xq'
--- test/rbkt/Queries/zorba/windowing/q9s.xq	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/q9s.xq	2012-03-13 03:02:21 +0000
@@ -0,0 +1,19 @@
+import schema default element namespace "" at "person_events.xsd";
+
+declare variable $seq := validate { fn:doc("person_events.xml") };
+
+<result>{
+for sliding window $w in $seq/stream/event
+  start  $s when $s/direction eq "in"
+  only end  $e when $s/person eq $e/person and
+    $e/direction eq "out"
+let $person := $s/person
+let $workingTime := xs:dateTime($e/@time) - xs:dateTime($s/@time)
+group by $person
+order by $person
+return
+  <working-time>
+    <person>{ $person }</person>
+    <time>{ sum($workingTime) }</time>
+  </working-time>
+}</result>

=== modified file 'test/rbkt/Queries/zorba/windowing/rss.xml'
--- test/rbkt/Queries/zorba/windowing/rss.xml	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/rss.xml	2012-03-13 03:02:21 +0000
@@ -1,4 +1,4 @@
-<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="rss.xsd">
+<rss>
   <channel>
     <title>DBIS RSS</title>
     <link>http://www.dbis.ethz.ch</link>

=== added file 'test/rbkt/Queries/zorba/windowing/rss.xsd'
--- test/rbkt/Queries/zorba/windowing/rss.xsd	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/rss.xsd	2012-03-13 03:02:21 +0000
@@ -0,0 +1,29 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+    <xs:element name="rss">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="channel">
+                    <xs:complexType>
+                        <xs:sequence>
+                            <xs:element name="title" type="xs:string"/>
+                            <xs:element name="link" type="xs:anyURI"/>
+                            <xs:element name="description" type="xs:string"/>
+                            <xs:element name="language" type="xs:string"/>
+                            <xs:element ref="item" maxOccurs="unbounded"/>
+                        </xs:sequence>
+                    </xs:complexType>
+                </xs:element>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+    <xs:element name="item">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="title" type="xs:string"/>
+                <xs:element name="category" type="xs:string"/>
+                <xs:element name="author" type="xs:string"/>
+                <xs:element name="pubDate" type="xs:dateTime"/>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+</xs:schema>

=== modified file 'test/rbkt/Queries/zorba/windowing/temp_events.xml'
--- test/rbkt/Queries/zorba/windowing/temp_events.xml	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/temp_events.xml	2012-03-13 03:02:21 +0000
@@ -1,9 +1,9 @@
-<stream xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="temp_events.xsd">
+<stream>
   <event temp="10" time="1"/>
   <event temp="8" time="2"/>
   <event temp="6" time="3"/>
   <event temp="13" time="4"/>
-  <event temp="33" time="5"/>
-  <event temp="10" time="6"/>
+  <event temp="32" time="5"/>
+  <event temp="9" time="6"/>
   <event temp="10" time="7"/>
 </stream>

=== added file 'test/rbkt/Queries/zorba/windowing/temp_events.xsd'
--- test/rbkt/Queries/zorba/windowing/temp_events.xsd	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/temp_events.xsd	2012-03-13 03:02:21 +0000
@@ -0,0 +1,14 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+    <xs:element name="stream">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:element name="event" maxOccurs="unbounded">
+                    <xs:complexType>
+                        <xs:attribute name="time" type="xs:integer" use="required"/>
+                        <xs:attribute name="temp" type="xs:double" use="required"/>
+                    </xs:complexType>
+                </xs:element>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+</xs:schema>

=== modified file 'test/rbkt/Queries/zorba/windowing/term_def_list.xml'
--- test/rbkt/Queries/zorba/windowing/term_def_list.xml	2011-01-24 11:43:14 +0000
+++ test/rbkt/Queries/zorba/windowing/term_def_list.xml	2012-03-13 03:02:21 +0000
@@ -1,4 +1,4 @@
-<doc  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:noNamespaceSchemaLocation="term_def_list.xsd">
+<doc>
   <dt>XML</dt>
   <dd>Extensible Markup Language</dd>
   <dt>XSLT</dt>

=== added file 'test/rbkt/Queries/zorba/windowing/term_def_list.xsd'
--- test/rbkt/Queries/zorba/windowing/term_def_list.xsd	1970-01-01 00:00:00 +0000
+++ test/rbkt/Queries/zorba/windowing/term_def_list.xsd	2012-03-13 03:02:21 +0000
@@ -0,0 +1,12 @@
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>
+    <xs:element name="doc">
+        <xs:complexType>
+            <xs:sequence>
+                <xs:sequence maxOccurs="unbounded">
+                    <xs:element name="dt" type="xs:string" maxOccurs="unbounded"/>
+                    <xs:element name="dd" type="xs:string" maxOccurs="unbounded"/>
+                </xs:sequence>
+            </xs:sequence>
+        </xs:complexType>
+    </xs:element>
+</xs:schema>


Follow ups