forked from qt4cg/qt4tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
catalog-schema.xsd
1680 lines (1527 loc) · 76.4 KB
/
catalog-schema.xsd
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="xsd.xsl" type="text/xsl"?>
<xs:schema targetNamespace="http://www.w3.org/2010/09/qt-fots-catalog" elementFormDefault="qualified" attributeFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"
xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"/>
<xs:annotation>
<xs:documentation>
<h1>QT3 Test Suite Schema</h1>
<p>
This schema documentation describes the elements and attributes
which are to be used in the catalog and test-set instance
documents, and belong to the QT3 test suite (known during development as FOTS).
</p>
<p>QT3 derives from the W3C <a href="http://dev.w3.org/cvsweb/2007/xpath-full-text-10-test-suite/" target="_blank">XQuery</a> and
<a href="http://dev.w3.org/2006/xquery-test-suite/PublicPagesStagingArea/" target="_blank">XSLT test suites</a>, where we
intend to overcome the following problems with the existing test suites:
<ul>
<li>Duplication across the XSLT and XQuery test suites</li>
<li>Very large XQuery test suite which has become somewhat disorganised and cumbersome to find specific tests or
find all test for a particular function</li>
<li>Unavailability of the XSLT test suite to the general public</li>
<li>Serialization issues of the test results, where the comparing of canonicalized XML documents, is
unnecessarily cumbersome for the typical function test that returns an atomic value.</li>
<li>Usability problems for standalone XPath processors and other host languages that use XPath</li>
<li></li>
</ul>
</p>
<p>This schema describes two kinds of file: the master catalog file, rooted at a
<code>catalog</code> element, and test-set files, which are rooted at a <code>test-set</code>
element. The catalog file contains a sequence of <code>test-set</code> elements which are
references to the test-set files.</p>
</xs:documentation>
</xs:annotation>
<xs:element name="catalog">
<xs:annotation>
<xs:documentation>
<div>
<h3>catalog</h3>
<p>
Denotes the root element of the catalog document.
The catalog lists all test-sets that are to be run and
also contains an environment of assorted schemas and source documents.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="environment" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="test-set" maxOccurs="unbounded">
<xs:complexType>
<xs:complexContent>
<xs:extension base="baseType">
<xs:attributeGroup ref="nameAttr" />
<xs:attributeGroup ref="fileAttr" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="version" type="xs:decimal">
<xs:annotation>
<xs:documentation>
<p>Identifies the version of the test suite. Should be incremented each time
the test suite is released.</p>
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="test-suite" type="xs:string" >
<xs:annotation>
<xs:documentation>
<p>Identifies this test suite (in case there are several test suites using this format)</p>
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="environment">
<xs:annotation>
<xs:documentation>
<div>
<h3>environment</h3>
<p>
Denotes an element which defines an assorted list of schemas and sources documents available to test cases.
For definition of schemas the test drivers should assume a dependency on schema-awareness.</p>
<p> In addition the environment may set further information about the static context for running the test.</p>
<p>
An environment can be made globally available across all test-sets,
or within a particular test-set or within a test-case.
Locally-defined environments are considered to have precedence over
environments defined at some ancestor node, therefore conflicts are avoided.
</p>
<p>
An environment that is shared between test cases always has a name (given by its <code>name</code> attribute).
An environment element within a test case may either be a reference to a shared environment (identified
by its <code>ref</code> attribute) or a locally-defined environment (with no <code>name</code> or <code>ref</code>
attributes.</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:complexContent>
<xs:extension base="baseType">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="schema" />
<xs:element ref="source" />
<xs:element ref="resource" />
<xs:element ref="param" />
<xs:element ref="context-item" />
<xs:element ref="decimal-format" />
<xs:element ref="namespace" />
<xs:element ref="function-library" />
<xs:element ref="collection" />
<xs:element ref="static-base-uri" />
<xs:element ref="collation" />
</xs:choice>
<xs:attributeGroup ref="nameAttr" />
<xs:attributeGroup ref="refAttr" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="static-base-uri">
<xs:annotation>
<xs:documentation>
<div>
<h3>static-base-uri</h3>
<p>An element used to supply the static base URI for a query. The <code>uri</code> attribute
should be an absolute URI.</p>
<p>In the absence of this element, or of a base URI declaration in the query prolog,
the static base URI of a query is the file containing the text of the query.</p>
<p>The value <code>uri='#UNDEFINED'</code> indicates that the test expects the static base URI
to be absent.</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="uriAttr" />
</xs:complexType>
</xs:element>
<xs:element name="collation">
<xs:annotation>
<xs:documentation>
<div>
<h3>collation</h3>
<p>An element which defines a collation URI used in the query.</p>
<p>The <code>uri</code>
attribute is the collation URI as it actually appears in the XPath expression. There is
a small enumerated set of collation URIs that may appear in tests; these have a meaning
that is defined in the test suite. In addition, from 3.1 onwards, URIs in the Unicode
Collation Algorithm family can be used. If the implementation cannot bind arbitrary URIs to
collations, it may substitute this URI in the source expression by a different one having
the same semantics. If the implementation does not support the semantics of the collation,
then it should not run the test (support for collations other than the codepoint collation
is not a conformance requirement.
</p>
<p>The <code>default</code> attribute indicates whether this collation is to be used as the
default collation.</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="uri">
<xs:simpleType>
<xs:union>
<xs:simpleType>
<xs:restriction base="xs:anyURI">
<xs:enumeration value="http://www.w3.org/2005/xpath-functions/collation/codepoint">
<xs:annotation>
<xs:documentation>
<p>This is the standard codepoint collation which all implementations must support</p>
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive">
<xs:annotation>
<xs:documentation>
<p>This URI is used to represent the case-blind collation defined in HTML5, which
must be supported by all XPath 3.1 and XQuery 3.1 processors. It is defined only
for use in equality comparisons, not for ordering. ASCII letters are compared
case-blind; all other Unicode characters are compared by codepoint.</p>
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="xs:anyURI">
<xs:pattern value="http://www.w3.org/2013/collation/UCA\?.*"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="default" type="xs:boolean" use="optional" default="false">
<xs:annotation>
<xs:documentation>
<p>The value <code>default="true"</code> indicates that this collation is to be the default collation
in the static context.</p>
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="decimal-format">
<xs:annotation>
<xs:documentation>
<div>
<h3>decimal-format</h3>
<p>The <code>decimal-format</code> element allows a decimal format to be defined as part of the
static context for evaluating an XPath expression that calls the format-number() function.</p>
<p>When the <code>decimal-format</code> element is used in an environment, the test expression
will always be a simple XPath expression. If the test is to be run using an XQuery processor,
the decimal format can be added to the static context either by using the processor's API, or
by constructing a query prolog containing a <code>declare decimal format</code> declaration and
prepending this to the test expression.</p>
<p>The mechanism is used for testing the format-number() function. As such, the decimal format
being defined should always be valid. Tests for invalid decimal formats should be written
as XQuery tests with an explicit query prolog (or the equivalent in XSLT).</p>
<p>Test Catalog006 ensures that the decimal-format element is only used in tests that are
pure XPath expressions.</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="name" type="xs:QName"/>
<xs:attribute name="decimal-separator" type="dual-char"/>
<xs:attribute name="grouping-separator" type="dual-char"/>
<xs:attribute name="zero-digit" type="one-char"/>
<xs:attribute name="digit" type="one-char"/>
<xs:attribute name="minus-sign" type="one-char"/>
<xs:attribute name="percent" type="dual-char"/>
<xs:attribute name="per-mille" type="dual-char"/>
<xs:attribute name="pattern-separator" type="one-char"/>
<xs:attribute name="exponent-separator" type="dual-char"/>
<xs:attribute name="infinity" type="xs:string"/>
<xs:attribute name="NaN" type="xs:string"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="one-char">
<xs:annotation>
<xs:documentation>
<p>A simple type representing a string whose length is exactly one character.</p>
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="." />
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="dual-char">
<xs:annotation>
<xs:documentation>
<p>The QT4 specs allow some decimal-format properties to take the form exemplified by "%:pc".</p>
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value=".(:.*)?" />
</xs:restriction>
</xs:simpleType>
<xs:element name="param">
<xs:annotation>
<xs:documentation>
<div>
<h3>param</h3>
<p>
An element within an environment that declares a variable that can be referenced
within test expressions that use this environment.
</p>
<p>The value to be bound to the variable is given in the select attribute, which should
be a simple XPath expression - typically a literal, or a simple call on a constructor function.</p>
<p>
The test expression may or may not include a declaration of the variable (so it can be
executed if appropriate using XPath). The "declared" attribute will be present with the
value "true" if the variable is declared in the query prolog. The test driver can add a declaration of the
variable to the query prolog if required. If the test expression includes the string
"(:%VARDECL%:)" then the variable declaration should be added to replace this string;
if it does not include this string, the variable declaration can be added at the start.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="name" type="xs:QName" use="required"/>
<xs:attribute name="select" type="xs:string" use="optional"/>
<xs:attribute name="as" type="xs:string" use="optional"/>
<xs:attribute name="source" type="xs:string" use="optional"/>
<xs:attribute name="declared" type="xs:boolean" use="optional" default="false"/>
</xs:complexType>
</xs:element>
<xs:element name="context-item">
<xs:annotation>
<xs:documentation>
<div>
<h3>context-item</h3>
<p>
An element within an environment that declares the value of the context item
for a query.</p>
<p>The value to be bound to the variable is given in the select attribute, which should
be a simple XPath expression - typically a literal, or a simple call on a constructor function.</p>
<p>
The query is called with the value of the select expression as the context item.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="select" type="xs:string" use="optional"/>
</xs:complexType>
</xs:element>
<xs:element name="collection">
<xs:annotation>
<xs:documentation>
<div>
<h3>collection</h3>
<p>
Represents a collection accessible to the collection() function.
</p>
<p>The <code>uri</code> attribute identifies the collection URI. If this is
absent or zero-length, the collection acts as the default collection, used
when no URI is supplied to the <code>collection()</code> function.</p>
<p>The contained <code>source</code> elements identify the documents making
up the collection.</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="source" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="resource" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="query" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attributeGroup ref="uriAttr"/>
</xs:complexType>
</xs:element>
<xs:element name="function-library">
<xs:annotation>
<xs:documentation>
<div>
<h3>function-library</h3>
<p>
An element which provides access to a function library defined for xslt and xquery.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="nameAttr" />
<xs:attribute name="xslt-location" />
<xs:attribute name="xquery-location" />
</xs:complexType>
</xs:element>
<xs:element name="namespace">
<xs:annotation>
<xs:documentation>
<div>
<h3>namespace</h3>
<p>
When this element is present in an environment, queries using this environment must
have a namespace binding in the static context that binds the specified prefix to the
specified namespace URI.</p>
<p> A zero-length prefix denotes the default
namespace for elements and types.</p>
<p>
All tests using an environment that contains a <code>namespace</code> element will
be simple XPath expressions, so that the test can be run either under XPath or XQuery.
If the test is run using an XPath processor, the namespace must be declared externally
using the processor's API. If it is run using an XQuery processor, the namespace can
either be declared externally using the processor's API, or a "declare namespace"
declaration can be added to the query prolog. Because the test is guaranteed to be a
simple XPath expression, adding the namespace declaration at the start is straightforward. </p>
<p> Test Catalog005 checks that no test that requires XQuery uses an environment that contains
a namespace element. </p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="prefix" />
<xs:attribute name="uri" />
</xs:complexType>
</xs:element>
<xs:element name="query" >
<xs:annotation>
<xs:documentation>
<div>
<h3>query</h3>
<p>
The content of the element is an XQuery expression to be evaluated. This should return a sequence equivalent
to the contents of a sequence which can used as input to test cases. Specifically used in fn:collection.
The scope of the <query> element is the parent <collection> element in which it appears.
</p>
<p>For example: unparsed-text-lines('xxx')!parse-json()</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="schema" type="schemaType" >
<xs:annotation>
<xs:documentation>
<div>
<h3>schema</h3>
<p>
An element which provides information about a schema to be used to validate a source document.
The scope of the <schema> element is the parent <environment> element in which it appears.
The test drivers should assume a dependency on schema-awareness.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="baseType" abstract="true">
<xs:attribute ref="xml:id"/>
</xs:complexType>
<xs:complexType name="schemaType">
<xs:annotation>
<xs:documentation>
<div>
<h3>schemaType</h3>
<p>
The type definition for the <code>schema</code> element
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="baseType">
<xs:sequence >
<xs:element ref="description" minOccurs="0" maxOccurs="1"/>
<xs:element ref="created" minOccurs="0" maxOccurs="1"/>
<xs:element ref="modified" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attributeGroup ref="uriAttr" />
<xs:attributeGroup ref="fileAttr" />
<xs:attribute name="xsd-version" type="xs:decimal" default="1.0"/>
<xs:attributeGroup ref="roleAttr" />
<!--<xs:attributeGroup ref="lastModAttr" />-->
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="source" type="sourceType" >
<xs:annotation>
<xs:documentation>
<div>
<h3>source</h3>
<p>
An element which provides information about a source xml file used as input to test cases.</p>
<p> The <code>role</code> and <code>uri</code> attributes indicate how the source document is made
available to queries (as the context item, as the value of an external variable, or as a URI that can be
supplied to the doc() function.)</p>
<p> The <code>file</code> attribute gives the relative location of the file containing the XML source.</p>
<p> The scope of the <source> element is
the parent <environment> element in which it appears. A validated source
document references the schema, which maps to the @id of the Schema element.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="sourceType">
<xs:annotation>
<xs:documentation>
<div>
<h3>sourceType</h3>
<p>
defines the type of the <code>source</code> element.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="baseType">
<xs:sequence>
<xs:element ref="description" minOccurs="0" maxOccurs="1"/>
<xs:element ref="created" minOccurs="0" maxOccurs="1"/>
<xs:element ref="modified" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attributeGroup ref="roleAttr"/>
<xs:attributeGroup ref="fileAttr" />
<xs:attributeGroup ref="uriAttr" />
<xs:attributeGroup ref="validationAttr" />
<xs:attribute name="mutable" type="xs:boolean" use="optional"/>
<xs:attribute name="declared" type="xs:boolean" use="optional"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="resource" type="resourceType" >
<xs:annotation>
<xs:documentation>
<div>
<h3>resource</h3>
<p>
An element which provides information about a file that can be read as text, used as input to test cases.</p>
<p> The <code>uri</code> attributes indicate how the resource is made available to queries (as a URI that can be supplied to the unparsed-text(), unparsed-text-lines() and unparsed-text-available() functions.)</p>
<p> The <code>file</code> attribute gives the relative location of the file containing the resource.</p>
<p> The optional <code>media-type</code> attribute gives the media type of the resource.</p>
<p> The optional <code>encoding</code> attribute gives the name of the encoding of the resource.</p>
<p> The scope of the <resource> element is
the parent <environment> element in which it appears. A validated source
document references the schema, which maps to the @id of the Schema element.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="resourceType">
<xs:annotation>
<xs:documentation>
<div>
<h3>resourceType</h3>
<p>
defines the type of the <code>resource</code> element.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="baseType">
<xs:sequence>
<xs:sequence >
<xs:element ref="description" minOccurs="0" maxOccurs="1"/>
<xs:element ref="created" minOccurs="0" maxOccurs="1"/>
<xs:element ref="modified" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:sequence>
<xs:attributeGroup ref="fileAttr" />
<xs:attributeGroup ref="uriAttr" />
<xs:attributeGroup ref="media-typeAttr"/>
<xs:attributeGroup ref="encodingAttr"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:element name="description">
<xs:annotation>
<xs:documentation>
<div>
<h3>description</h3>
<p>
An element which provides descriptive information about the
resource described by its parent element.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="test-set">
<xs:annotation>
<xs:documentation>
<div>
<h3>test-set</h3>
<p>
denotes an element which provides a sequence of test-case entries for a particular function.
Within this element we provide data needed to run the test for that function.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:choice maxOccurs="unbounded">
<xs:element ref="description"/>
<xs:element ref="link" />
<xs:element ref="environment"/>
<xs:element ref="dependency"/>
</xs:choice>
<xs:element ref="test-case" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attributeGroup ref="nameAttr" />
<xs:attributeGroup ref="coversAttr" />
<xs:attributeGroup ref="covers30Attr" />
</xs:complexType>
</xs:element>
<xs:element name="dependency">
<xs:annotation>
<xs:documentation>
<div>
<h3>dependency</h3>
<p>Indicates a dependency which must be satisfied in order for a test to be run.</p>
<p>A dependency may be associated with an individual test case or with
a test-set. A dependency at the level of a test-set applies to all test cases in
that test-set.</p>
<p>The attribute setting <code>satisfied="false"</code> indicates that the test should only
be run if the dependency is NOT satisfied.</p>
<p>The set of recognized values appearing in the <code>value</code> attribute
depends on the content of the <code>type</code> attribute.</p>
<p>The most commonly-used dependency is on the version of XPath or XQuery. This
is represented by a dependency with <code>type="spec"</code> whose corresponding
value is, for example <code>value="XQ10+ XP30+"</code> which indicates that the
test can be run with XQuery 1.0 or later, or XPath 3.0 or later. A test with
<code>value="XQ10"</code> should be run with an XQuery 1.0 processor only (typically,
an XQuery 3.0 processor will produce a different result, described in a separate
test case.)</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="typeAttr" />
<xs:attributeGroup ref="valueAttr" />
<xs:attribute name="satisfied" type="xs:boolean" default="true">
<xs:annotation>
<xs:documentation>
<p>The default value "true" indicates that the dependency must be satisified
for the test to run</p>
<p>The setting "false" indicates that the test should only be run if the
dependency is NOT satisfied. For example, this might be used in a test to
show what happens if a language (such as <code>lang="jp"</code> is requested
and the processor does not support that language.</p>
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="test-case">
<xs:annotation>
<xs:documentation>
<div>
<h3>test-case</h3>
<p>
denotes an element that contains a test that must be run in a named environment,
also contains the expected result and description of the test, including author
and creation date.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="description" />
<xs:element ref="created" />
<xs:element ref="modified" minOccurs="0" maxOccurs="unbounded"/>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="environment"/> <!-- must only appear once -->
<xs:element ref="module"/>
<xs:element ref="dependency"/>
</xs:choice>
<xs:element ref="test" minOccurs="1" maxOccurs="unbounded"/>
<xs:element ref="result" />
</xs:sequence>
<xs:attributeGroup ref="nameAttr" />
<xs:attributeGroup ref="coversAttr" />
<xs:attributeGroup ref="covers30Attr" />
</xs:complexType>
</xs:element>
<xs:element name="test">
<xs:annotation>
<xs:documentation>
<div>
<h3>test</h3>
<p>
The content of the element is an XPath or XQuery expression to be evaluated.
</p>
<p>
As an alternative to providing the content inline, it may be provided in an external
file referenced using the <code>file</code> attribute. This is done only exceptionally, where (a)
the query is unusually large, or (b) there is a need to test features that can only
be achieved with an external file, for example special encodings.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="file" type="xs:anyURI" use="optional"/>
<xs:attribute name="update" type="xs:boolean" use="optional"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="created">
<xs:annotation>
<xs:documentation>
<div>
<h3>created</h3>
<p>
Provides details of the author and creation date of a test case, source document, schema, etc.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="byAttr" />
<xs:attributeGroup ref="onAttr" />
</xs:complexType>
</xs:element>
<xs:element name="modified">
<xs:annotation>
<xs:documentation>
<div>
<h3>modified</h3>
<p>
Provides a record of changes made to a test case or other resource over time.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attributeGroup ref="byAttr" />
<xs:attributeGroup ref="onAttr" />
<xs:attributeGroup ref="changeAttr" />
</xs:complexType>
</xs:element>
<xs:element name="module">
<xs:annotation>
<xs:documentation>
<div>
<h3>module</h3>
<p>
Defines an XQuery library module imported by a test case. The module element has an <code>@uri</code> attribute
giving the module URI and an <code>@file</code> attribute giving the location of the module (relative to the test
set document).
</p>
<p>
If the query contains an "import module" declaration
referencing the same module URI, with no "at" location, then the library module is to be found
at the location given by the <code>@file</code> attribute.
</p>
<p>
If the query metadata contains several module elements giving the same module URI and different file
locations, the processor is expected to import all the modules referenced.
</p>
<p>If the query contains an "import module" declaration containing one or more "at" location hints,
then the test metadata should contain for each of these location hints, a <code>module</code>
element whose <code>@uri</code> attribute matches the module namespace, and whose <code>@location</code>
attribute matches the location hint (the match being done after absolutizing both URIs against their
respective base URIs). Each location hint then results in a module being loaded from the corresponding
file, identified by the <code>@file</code> attribute.</p>
<p>Location hints are used only when testing XQuery 3.0 or higher, since in 1.0 their semantics
were almost entirely implementation-defined.</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="uri" type="xs:anyURI"/>
<xs:attribute name="location" type="xs:anyURI" use="optional"/>
<xs:attribute name="file" type="xs:anyURI"/>
</xs:complexType>
</xs:element>
<xs:element name="result">
<xs:annotation>
<xs:documentation>
<div>
<h3>result</h3>
<p>
denotes an element which provides an <assert> or >error< element pertaining the expected result.
Alternatively assertions can appears as a list within <any-of> or <all-of> element.
The meaning of these elements are self explantary.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="abstractAssertion"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="SequenceOfAssertionsType">
<xs:annotation>
<xs:documentation>
<div>
<h3>complexType for a sequence of assertions</h3>
<p>
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element ref="abstractAssertion" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:element name="any-of" type="SequenceOfAssertionsType" substitutionGroup="abstractAssertion">
<xs:annotation>
<xs:documentation>
<div>
<h3>any-of</h3>
<p>
denotes an element which provides a list of assertions.
One or more of the assertions needs to prove true for the test to pass,
but if all fail then the test fails.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="all-of" type="SequenceOfAssertionsType" substitutionGroup="abstractAssertion">
<xs:annotation>
<xs:documentation>
<div>
<h3>all-of</h3>
<p>
denotes an element which provides a list of assertions that must be all satisfied,
if any of the assertions proves to be false then the test fails.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="not" substitutionGroup="abstractAssertion">
<xs:annotation>
<xs:documentation>
<div>
<h3>not</h3>
<p>
Negates an assertion: this assertion is satisfied if the contained assertion fails,
and vice versa. Particularly useful with assert-serialization-matches.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="abstractAssertion"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="abstractAssertion" abstract="true" type="xs:anyType" >
<xs:annotation>
<xs:documentation>
<div>
<h3>abstractAssertion</h3>
<p>
Abstract superclass for the various kinds of assertion.
</p>
</div>
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="assert" substitutionGroup="abstractAssertion">
<xs:annotation>
<xs:documentation>
<div>
<h3>assert</h3>
<p>
The assert element contains an XPath expression whose effective boolean
value must be true; usually the expression will use the variable $result
which references the result of the expression.
</p>
<p>For example, <code><assert>matches(string($result), '[0-9]{3}')</assert></code>
asserts that the result of the test expression is a three-digit number.</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="assert-eq" substitutionGroup="abstractAssertion">
<xs:annotation>
<xs:documentation>
<div>
<h3>assert-eq</h3>
<p>
The assert element contains an XPath expression (usually a simple string or numeric literal) which must
be equal to the result of the test case under the rules of the XPath 'eq' operator.
</p>
<p>For example, <code><assert-eq>12</assert-eq></code>
asserts that the result of the test expression is an atomic value that compares
equal to the integer 12 (which means it might be the double value 12.0 or the
float value 12.0 or the untyped atomic value "12.0", for example).</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="assert-count" substitutionGroup="abstractAssertion">
<xs:annotation>
<xs:documentation>
<div>
<h3>assert-count</h3>
<p>
Asserts that the result must be a sequence containing a given number of items.
The value of the element is an integer giving the expected length of the sequence.
</p>
</div>
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:integer" />
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="assert-deep-eq" substitutionGroup="abstractAssertion">
<xs:annotation>
<xs:documentation>
<div>
<h3>assert-deep-eq</h3>
<p>
Asserts that the result must be a sequence of atomic values that is deep-equal
to the supplied sequence under the rules of the deep-equal() function.
</p>
</div>