summaryrefslogtreecommitdiff
path: root/tests/exslt/date/sum.2.xml
blob: f5f77fea8c970f2e2c80ab8626d375cbc4b42bc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?xml version="1.0"?>
<page>
  <!-- sum of empty node-set -->
  <sum/>

  <!-- According to http://exslt.org/date/functions/add-duration/
       add-duration should fail when a sum involving negative durations
       involve borrowing -->
  <sum>
    <date dur='P1M'/>
    <date dur='-P1D'/>
  </sum>

  <sum>
    <date dur='P1M'/>
    <date dur='-P1D'/>
    <date dur='P1D'/>
  </sum>

  <!-- ... but switching the order should make it work -->
  <sum>
    <date dur='P1M'/>
    <date dur='P1D'/>
    <date dur='-P1D'/>
  </sum>

  <!-- Empty durations -->
  <sum>
    <date dur=''/>
  </sum>

  <sum>
    <date dur=''/>
    <date dur='P45S'/>
  </sum>

  <!-- Invalid durations -->
  <sum>
    <date dur='2004-09-20'/>
  </sum>

  <sum>
    <date dur='1H'/>
  </sum>

  <sum>
    <date dur='2004-09-22'/>
    <date dur='P1D'/>
  </sum>

  <sum>
    <date dur='P2D'/>
    <date dur='--P1D'/>
  </sum>
</page>