-
Notifications
You must be signed in to change notification settings - Fork 7
/
catalog-schema.html
2744 lines (2034 loc) · 114 KB
/
catalog-schema.html
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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Schema document for namespace http://www.w3.org/2010/09/qt-fots-catalog</title><style type="text/css">
.bodytext .bodytext {
margin-left: 0;
margin-right: 0;
}
.bodytext {
margin-left: 15%;
margin-right: 2%;
}
.annotation {
}
.same-ns {
color: Green;
}
.diff-ns {
color: maroon;
}
.warning {
color: red;
}
p.note {
font-style: italic;
}
p.dt {
font-weight: bold;
}
span.rfc {
font-variant: small-caps;
}
</style></head>
<body>
<h1>Schema document for namespace http://www.w3.org/2010/09/qt-fots-catalog</h1>
<div>
<hr>
<ul class="bodytext">
<li><a href="#ann_1">Annotation 1</a></li>
<li><a href="#attgrp_byAttr">Attribute group <em>byAttr</em></a></li>
<li><a href="#attgrp_changeAttr">Attribute group <em>changeAttr</em></a></li>
<li><a href="#attgrp_codeAttr">Attribute group <em>codeAttr</em></a></li>
<li><a href="#attgrp_covers30Attr">Attribute group <em>covers30Attr</em></a></li>
<li><a href="#attgrp_coversAttr">Attribute group <em>coversAttr</em></a></li>
<li><a href="#attgrp_creatorAttr">Attribute group <em>creatorAttr</em></a></li>
<li><a href="#attgrp_documentAttr">Attribute group <em>documentAttr</em></a></li>
<li><a href="#attgrp_encodingAttr">Attribute group <em>encodingAttr</em></a></li>
<li><a href="#attgrp_fileAttr">Attribute group <em>fileAttr</em></a></li>
<li><a href="#attgrp_media-typeAttr">Attribute group <em>media-typeAttr</em></a></li>
<li><a href="#attgrp_nameAttr">Attribute group <em>nameAttr</em></a></li>
<li><a href="#attgrp_onAttr">Attribute group <em>onAttr</em></a></li>
<li><a href="#attgrp_refAttr">Attribute group <em>refAttr</em></a></li>
<li><a href="#attgrp_roleAttr">Attribute group <em>roleAttr</em></a></li>
<li><a href="#attgrp_typeAttr">Attribute group <em>typeAttr</em></a></li>
<li><a href="#attgrp_uriAttr">Attribute group <em>uriAttr</em></a></li>
<li><a href="#attgrp_validationAttr">Attribute group <em>validationAttr</em></a></li>
<li><a href="#attgrp_valueAttr">Attribute group <em>valueAttr</em></a></li>
<li><a href="#type_SequenceOfAssertionsType">Complex type <em>SequenceOfAssertionsType</em></a></li>
<li><a href="#type_baseType">Complex type <em>baseType</em></a></li>
<li><a href="#type_resourceType">Complex type <em>resourceType</em></a></li>
<li><a href="#type_schemaType">Complex type <em>schemaType</em></a></li>
<li><a href="#type_sourceType">Complex type <em>sourceType</em></a></li>
<li><a href="#elem_abstractAssertion">Element <em>abstractAssertion</em></a></li>
<li><a href="#elem_all-of">Element <em>all-of</em></a></li>
<li><a href="#elem_any-of">Element <em>any-of</em></a></li>
<li><a href="#elem_assert">Element <em>assert</em></a></li>
<li><a href="#elem_assert-count">Element <em>assert-count</em></a></li>
<li><a href="#elem_assert-deep-eq">Element <em>assert-deep-eq</em></a></li>
<li><a href="#elem_assert-empty">Element <em>assert-empty</em></a></li>
<li><a href="#elem_assert-eq">Element <em>assert-eq</em></a></li>
<li><a href="#elem_assert-false">Element <em>assert-false</em></a></li>
<li><a href="#elem_assert-permutation">Element <em>assert-permutation</em></a></li>
<li><a href="#elem_assert-serialization-error">Element <em>assert-serialization-error</em></a></li>
<li><a href="#elem_assert-string-value">Element <em>assert-string-value</em></a></li>
<li><a href="#elem_assert-true">Element <em>assert-true</em></a></li>
<li><a href="#elem_assert-type">Element <em>assert-type</em></a></li>
<li><a href="#elem_assert-xml">Element <em>assert-xml</em></a></li>
<li><a href="#elem_catalog">Element <em>catalog</em></a></li>
<li><a href="#elem_collation">Element <em>collation</em></a></li>
<li><a href="#elem_collection">Element <em>collection</em></a></li>
<li><a href="#elem_context-item">Element <em>context-item</em></a></li>
<li><a href="#elem_created">Element <em>created</em></a></li>
<li><a href="#elem_decimal-format">Element <em>decimal-format</em></a></li>
<li><a href="#elem_dependency">Element <em>dependency</em></a></li>
<li><a href="#elem_description">Element <em>description</em></a></li>
<li><a href="#elem_environment">Element <em>environment</em></a></li>
<li><a href="#elem_error">Element <em>error</em></a></li>
<li><a href="#elem_function-library">Element <em>function-library</em></a></li>
<li><a href="#elem_link">Element <em>link</em></a></li>
<li><a href="#elem_modified">Element <em>modified</em></a></li>
<li><a href="#elem_module">Element <em>module</em></a></li>
<li><a href="#elem_namespace">Element <em>namespace</em></a></li>
<li><a href="#elem_not">Element <em>not</em></a></li>
<li><a href="#elem_param">Element <em>param</em></a></li>
<li><a href="#elem_query">Element <em>query</em></a></li>
<li><a href="#elem_resource">Element <em>resource</em></a></li>
<li><a href="#elem_result">Element <em>result</em></a></li>
<li><a href="#elem_schema">Element <em>schema</em></a></li>
<li><a href="#elem_serialization-matches">Element <em>serialization-matches</em></a></li>
<li><a href="#elem_source">Element <em>source</em></a></li>
<li><a href="#elem_static-base-uri">Element <em>static-base-uri</em></a></li>
<li><a href="#elem_test">Element <em>test</em></a></li>
<li><a href="#elem_test-case">Element <em>test-case</em></a></li>
<li><a href="#elem_test-set">Element <em>test-set</em></a></li>
<li><a href="#imp_1">Import <code>http://www.w3.org/XML/1998/namespace</code></a></li>
<li><a href="#type_EQName">Simple type <em>EQName</em></a></li>
<li><a href="#type_dependencyEnumType">Simple type <em>dependencyEnumType</em></a></li>
<li><a href="#type_encodingType">Simple type <em>encodingType</em></a></li>
<li><a href="#type_one-char">Simple type <em>one-char</em></a></li>
<li><a href="#type_validationEnumType">Simple type <em>validationEnumType</em></a></li>
</ul>
<hr>
</div>
<div id="imp_1">
<h3><a name="imp_1">Import <code>http://www.w3.org/XML/1998/namespace</code></a></h3>
<div class="bodytext">
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:import
namespace="http://www.w3.org/XML/1998/namespace"
schemaLocation="xml.xsd"
xml:lang="en"/></pre></div>
</div>
</div>
<div class="annotation" id="ann_1">
<h3>Annotation</h3>
<div class="bodytext">
<h1 xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">QT3 Test Suite Schema</h1>
<p xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
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 xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">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 xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">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>
</div>
</div>
<div id="elem_catalog">
<h3><a name="elem_catalog">Element <em>catalog</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="catalog">
<xs:complexType>
<xs:sequence>
<xs:element ref="<a href="#elem_environment">environment</a>" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="test-set" maxOccurs="unbounded">
<xs:complexType>
<xs:complexContent>
<xs:extension base="<a href="#type_baseType">baseType</a>">
<xs:attributeGroup ref="<a href="#attgrp_nameAttr">nameAttr</a>"/>
<xs:attributeGroup ref="<a href="#attgrp_fileAttr">fileAttr</a>"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="version" type="<span class="external-link diff-ns">xs:decimal</span>">
</xs:attribute>
<xs:attribute name="test-suite" type="<span class="external-link diff-ns">xs:string</span>">
</xs:attribute>
</xs:complexType>
</xs:element></pre></div>
</div>
</div>
<div id="elem_environment">
<h3><a name="elem_environment">Element <em>environment</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="environment">
<xs:complexType>
<xs:complexContent>
<xs:extension base="<a href="#type_baseType">baseType</a>">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="<a href="#elem_schema">schema</a>"/>
<xs:element ref="<a href="#elem_source">source</a>"/>
<xs:element ref="<a href="#elem_resource">resource</a>"/>
<xs:element ref="<a href="#elem_param">param</a>"/>
<xs:element ref="<a href="#elem_context-item">context-item</a>"/>
<xs:element ref="<a href="#elem_decimal-format">decimal-format</a>"/>
<xs:element ref="<a href="#elem_namespace">namespace</a>"/>
<xs:element ref="<a href="#elem_function-library">function-library</a>"/>
<xs:element ref="<a href="#elem_collection">collection</a>"/>
<xs:element ref="<a href="#elem_static-base-uri">static-base-uri</a>"/>
<xs:element ref="<a href="#elem_collation">collation</a>"/>
</xs:choice>
<xs:attributeGroup ref="<a href="#attgrp_nameAttr">nameAttr</a>"/>
<xs:attributeGroup ref="<a href="#attgrp_refAttr">refAttr</a>"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element></pre></div>
</div>
</div>
<div id="elem_static-base-uri">
<h3><a name="elem_static-base-uri">Element <em>static-base-uri</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="static-base-uri">
<xs:complexType>
<xs:attributeGroup ref="<a href="#attgrp_uriAttr">uriAttr</a>"/>
</xs:complexType>
</xs:element></pre></div>
</div>
</div>
<div id="elem_collation">
<h3><a name="elem_collation">Element <em>collation</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="collation">
<xs:complexType>
<xs:attribute name="uri">
<xs:simpleType>
<xs:union>
<xs:simpleType>
<xs:restriction base="<span class="external-link diff-ns">xs:anyURI</span>">
<xs:enumeration value="http://www.w3.org/2005/xpath-functions/collation/codepoint">
</xs:enumeration>
<xs:enumeration
value="http://www.w3.org/2005/xpath-functions/collation/html-ascii-case-insensitive">
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
<xs:simpleType>
<xs:restriction base="<span class="external-link diff-ns">xs:anyURI</span>">
<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="<span class="external-link diff-ns">xs:boolean</span>" use="optional" default="false">
</xs:attribute>
</xs:complexType>
</xs:element></pre></div>
</div>
</div>
<div id="elem_decimal-format">
<h3><a name="elem_decimal-format">Element <em>decimal-format</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="decimal-format">
<xs:complexType>
<xs:attribute name="name" type="<span class="external-link diff-ns">xs:QName</span>"/>
<xs:attribute name="decimal-separator" type="<a href="#type_one-char">one-char</a>"/>
<xs:attribute name="grouping-separator" type="<a href="#type_one-char">one-char</a>"/>
<xs:attribute name="zero-digit" type="<a href="#type_one-char">one-char</a>"/>
<xs:attribute name="digit" type="<a href="#type_one-char">one-char</a>"/>
<xs:attribute name="minus-sign" type="<a href="#type_one-char">one-char</a>"/>
<xs:attribute name="percent" type="<a href="#type_one-char">one-char</a>"/>
<xs:attribute name="per-mille" type="<a href="#type_one-char">one-char</a>"/>
<xs:attribute name="pattern-separator" type="<a href="#type_one-char">one-char</a>"/>
<xs:attribute name="exponent-separator" type="<a href="#type_one-char">one-char</a>"/>
<xs:attribute name="infinity" type="<span class="external-link diff-ns">xs:string</span>"/>
<xs:attribute name="NaN" type="<span class="external-link diff-ns">xs:string</span>"/>
</xs:complexType>
</xs:element></pre></div>
</div>
</div>
<div id="type_one-char">
<h3><a name="type_one-char">Simple type <em>one-char</em></a></h3>
<div class="bodytext">
<div>
<h4>Notes</h4>
<p xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">A simple type representing a string whose length is exactly one character.</p>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:simpleType name="one-char">
<xs:restriction base="<span class="external-link diff-ns">xs:string</span>">
<xs:pattern value="."/>
</xs:restriction>
</xs:simpleType></pre></div>
</div>
</div>
<div id="elem_param">
<h3><a name="elem_param">Element <em>param</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="param">
<xs:complexType>
<xs:attribute name="name" type="<span class="external-link diff-ns">xs:QName</span>" use="required"/>
<xs:attribute name="select" type="<span class="external-link diff-ns">xs:string</span>" use="optional"/>
<xs:attribute name="as" type="<span class="external-link diff-ns">xs:string</span>" use="optional"/>
<xs:attribute name="source" type="<span class="external-link diff-ns">xs:string</span>" use="optional"/>
<xs:attribute name="declared" type="<span class="external-link diff-ns">xs:boolean</span>" use="optional" default="false"/>
</xs:complexType>
</xs:element></pre></div>
</div>
</div>
<div id="elem_context-item">
<h3><a name="elem_context-item">Element <em>context-item</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="context-item">
<xs:complexType>
<xs:attribute name="select" type="<span class="external-link diff-ns">xs:string</span>" use="optional"/>
</xs:complexType>
</xs:element></pre></div>
</div>
</div>
<div id="elem_collection">
<h3><a name="elem_collection">Element <em>collection</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="collection">
<xs:complexType>
<xs:sequence>
<xs:element ref="<a href="#elem_source">source</a>" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="<a href="#elem_resource">resource</a>" minOccurs="0" maxOccurs="unbounded"/>
<xs:element ref="<a href="#elem_query">query</a>" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attributeGroup ref="<a href="#attgrp_uriAttr">uriAttr</a>"/>
</xs:complexType>
</xs:element></pre></div>
</div>
</div>
<div id="elem_function-library">
<h3><a name="elem_function-library">Element <em>function-library</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<h3>function-library</h3>
<p>
An element which provides access to a function library defined for xslt and xquery.
</p>
</div>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="function-library">
<xs:complexType>
<xs:attributeGroup ref="<a href="#attgrp_nameAttr">nameAttr</a>"/>
<xs:attribute name="xslt-location"/>
<xs:attribute name="xquery-location"/>
</xs:complexType>
</xs:element></pre></div>
</div>
</div>
<div id="elem_namespace">
<h3><a name="elem_namespace">Element <em>namespace</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="namespace">
<xs:complexType>
<xs:attribute name="prefix"/>
<xs:attribute name="uri"/>
</xs:complexType>
</xs:element></pre></div>
</div>
</div>
<div id="elem_query">
<h3><a name="elem_query">Element <em>query</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="query">
</xs:element></pre></div>
</div>
</div>
<div id="elem_schema">
<h3><a name="elem_schema">Element <em>schema</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="schema" type="<a href="#type_schemaType">schemaType</a>">
</xs:element></pre></div>
</div>
</div>
<div id="type_baseType">
<h3><a name="type_baseType">Complex type <em>baseType</em></a></h3>
<div class="bodytext">
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:complexType name="baseType" abstract="true">
<xs:attribute ref="<span class="external-link diff-ns">xml:id</span>"/>
</xs:complexType></pre></div>
</div>
</div>
<div id="type_schemaType">
<h3><a name="type_schemaType">Complex type <em>schemaType</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<h3>schemaType</h3>
<p>
The type definition for the <code>schema</code> element
</p>
</div>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:complexType name="schemaType">
<xs:complexContent>
<xs:extension base="<a href="#type_baseType">baseType</a>">
<xs:sequence>
<xs:element ref="<a href="#elem_description">description</a>" minOccurs="0" maxOccurs="1"/>
<xs:element ref="<a href="#elem_created">created</a>" minOccurs="0" maxOccurs="1"/>
<xs:element ref="<a href="#elem_modified">modified</a>" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attributeGroup ref="<a href="#attgrp_uriAttr">uriAttr</a>"/>
<xs:attributeGroup ref="<a href="#attgrp_fileAttr">fileAttr</a>"/>
<xs:attribute name="xsd-version" type="<span class="external-link diff-ns">xs:decimal</span>" default="1.0"/>
<xs:attributeGroup ref="<a href="#attgrp_roleAttr">roleAttr</a>"/>
</xs:extension>
</xs:complexContent>
</xs:complexType></pre></div>
</div>
</div>
<div id="elem_source">
<h3><a name="elem_source">Element <em>source</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="source" type="<a href="#type_sourceType">sourceType</a>">
</xs:element></pre></div>
</div>
</div>
<div id="type_sourceType">
<h3><a name="type_sourceType">Complex type <em>sourceType</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<h3>sourceType</h3>
<p>
defines the type of the <code>source</code> element.
</p>
</div>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:complexType name="sourceType">
<xs:complexContent>
<xs:extension base="<a href="#type_baseType">baseType</a>">
<xs:sequence>
<xs:element ref="<a href="#elem_description">description</a>" minOccurs="0" maxOccurs="1"/>
<xs:element ref="<a href="#elem_created">created</a>" minOccurs="0" maxOccurs="1"/>
<xs:element ref="<a href="#elem_modified">modified</a>" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attributeGroup ref="<a href="#attgrp_roleAttr">roleAttr</a>"/>
<xs:attributeGroup ref="<a href="#attgrp_fileAttr">fileAttr</a>"/>
<xs:attributeGroup ref="<a href="#attgrp_uriAttr">uriAttr</a>"/>
<xs:attributeGroup ref="<a href="#attgrp_validationAttr">validationAttr</a>"/>
</xs:extension>
</xs:complexContent>
</xs:complexType></pre></div>
</div>
</div>
<div id="elem_resource">
<h3><a name="elem_resource">Element <em>resource</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<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>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:element name="resource" type="<a href="#type_resourceType">resourceType</a>">
</xs:element></pre></div>
</div>
</div>
<div id="type_resourceType">
<h3><a name="type_resourceType">Complex type <em>resourceType</em></a></h3>
<div class="bodytext">
<div>
<div xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2010/09/qt-fots-catalog">
<h3>resourceType</h3>
<p>
defines the type of the <code>resource</code> element.
</p>
</div>
</div>
<div>
<h4>Formal declaration in XSD source form</h4><pre>
<xs:complexType name="resourceType">
<xs:complexContent>
<xs:extension base="<a href="#type_baseType">baseType</a>">
<xs:sequence>
<xs:sequence>
<xs:element ref="<a href="#elem_description">description</a>" minOccurs="0" maxOccurs="1"/>
<xs:element ref="<a href="#elem_created">created</a>" minOccurs="0" maxOccurs="1"/>
<xs:element ref="<a href="#elem_modified">modified</a>" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:sequence>
<xs:attributeGroup ref="<a href="#attgrp_fileAttr">fileAttr</a>"/>
<xs:attributeGroup ref="<a href="#attgrp_uriAttr">uriAttr</a>"/>
<xs:attributeGroup ref="<a href="#attgrp_media-typeAttr">media-typeAttr</a>"/>
<xs:attributeGroup ref="<a href="#attgrp_encodingAttr">encodingAttr</a>"/>
</xs:extension>
</xs:complexContent>
</xs:complexType></pre></div>
</div>
</div>