libxml2 2.9.1 clean sources
[tomato.git] / release / src / router / libxml2 / test / relaxng / testsuite.xml
blob09a8f38136ae6d0645705dd2a78c6fa3a57aa884
1 <testSuite>\r
2 <author>Daniel Veillard</author>\r
3 <email>daniel@veillard.com</email>\r
4 <documentation>For libxml2 implementation of Relax NG spec.</documentation>\r
5 <testSuite>\r
6 <documentation>Test of node matches</documentation>\r
7 <testCase>\r
8 <correct>\r
9 <element xmlns="http://relaxng.org/ns/structure/1.0">\r
10   <anyName>\r
11     <except>\r
12       <nsName ns="http://example.org"/>\r
13     </except>\r
14   </anyName>\r
15   <empty/>\r
16 </element>\r
17 </correct>\r
18 <valid>\r
19 <foo/>\r
20 </valid>\r
21 <valid>\r
22 <foo xmlns="http://example.org/"/>\r
23 </valid>\r
24 <valid>\r
25 <foo xmlns="http://EXAMPLE.ORG"/>\r
26 </valid>\r
27 <invalid>\r
28 <foo xmlns="http://example.org"/>\r
29 </invalid>\r
30 <invalid>\r
31 <a:foo xmlns:a="http://example.org"/>\r
32 </invalid>\r
33 </testCase>\r
34 <testCase>\r
35 <correct>\r
36 <element name="top" xmlns="http://relaxng.org/ns/structure/1.0">\r
37   <interleave>\r
38     <element name="foo" ns="http://example.org">\r
39       <empty/>\r
40     </element>\r
41     <element>\r
42       <anyName>\r
43         <except>\r
44           <nsName ns="http://example.org"/>\r
45         </except>\r
46       </anyName>\r
47       <empty/>\r
48     </element>\r
49   </interleave>\r
50 </element>\r
51 </correct>\r
52 <invalid>\r
53 <top>\r
54 <foo/>\r
55 <bar/>\r
56 </top>\r
57 </invalid>\r
58 <invalid>\r
59 <top>\r
60 <foo xmlns="http://example.org"/>\r
61 <bar xmlns="http://example.org"/>\r
62 </top>\r
63 </invalid>\r
64 <valid>\r
65 <top>\r
66 <foo xmlns="http://example.org"/>\r
67 <bar/>\r
68 </top>\r
69 </valid>\r
70 <valid>\r
71 <top>\r
72 <bar/>\r
73 <foo xmlns="http://example.org"/>\r
74 </top>\r
75 </valid>\r
76 <valid>\r
77 <top>\r
78 <foo xmlns="http://example.org"/>\r
79 <bar xmlns="http://example.org/"/>\r
80 </top>\r
81 </valid>\r
82 <valid>\r
83 <top>\r
84 <bar xmlns="http://example.org/"/>\r
85 <foo xmlns="http://example.org"/>\r
86 </top>\r
87 </valid>\r
88 </testCase>\r
89 </testSuite>\r
90 <testSuite>\r
91 <documentation>Test of indeterminism</documentation>\r
92 <testCase>\r
93 <correct>\r
94 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
95   <zeroOrMore>\r
96     <element name="bar">\r
97       <empty/>\r
98     </element>\r
99   </zeroOrMore>\r
100   <element name="baz">\r
101     <empty/>\r
102   </element>\r
103 </element>\r
104 </correct>\r
105 <invalid>\r
106 <foo/>\r
107 </invalid>\r
108 <valid>\r
109 <foo>\r
110   <baz/>\r
111 </foo>\r
112 </valid>\r
113 <valid>\r
114 <foo>\r
115   <bar/>\r
116   <baz/>\r
117 </foo>\r
118 </valid>\r
119 <valid>\r
120 <foo>\r
121   <bar/>\r
122   <bar/>\r
123   <bar/>\r
124   <baz/>\r
125 </foo>\r
126 </valid>\r
127 </testCase>\r
128 <testCase>\r
129 <correct>\r
130 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
131   <zeroOrMore>\r
132     <element name="bar">\r
133       <empty/>\r
134     </element>\r
135   </zeroOrMore>\r
136   <element name="bar">\r
137     <empty/>\r
138   </element>\r
139 </element>\r
140 </correct>\r
141 <invalid>\r
142 <foo/>\r
143 </invalid>\r
144 <valid>\r
145 <foo>\r
146   <bar/>\r
147 </foo>\r
148 </valid>\r
149 <valid>\r
150 <foo>\r
151   <bar/>\r
152   <bar/>\r
153 </foo>\r
154 </valid>\r
155 <valid>\r
156 <foo>\r
157   <bar/>\r
158   <bar/>\r
159   <bar/>\r
160   <bar/>\r
161 </foo>\r
162 </valid>\r
163 </testCase>\r
164 <testCase>\r
165 <correct>\r
166 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
167   <group>\r
168     <zeroOrMore>\r
169       <element name="bar">\r
170         <empty/>\r
171       </element>\r
172     </zeroOrMore>\r
173     <element name="baz">\r
174       <empty/>\r
175     </element>\r
176   </group>\r
177 </element>\r
178 </correct>\r
179 <invalid>\r
180 <foo/>\r
181 </invalid>\r
182 <valid>\r
183 <foo>\r
184   <baz/>\r
185 </foo>\r
186 </valid>\r
187 <valid>\r
188 <foo>\r
189   <bar/>\r
190   <baz/>\r
191 </foo>\r
192 </valid>\r
193 <valid>\r
194 <foo>\r
195   <bar/>\r
196   <bar/>\r
197   <bar/>\r
198   <baz/>\r
199 </foo>\r
200 </valid>\r
201 </testCase>\r
202 <testCase>\r
203 <correct>\r
204 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
205   <group>\r
206     <zeroOrMore>\r
207       <element name="bar">\r
208         <empty/>\r
209       </element>\r
210     </zeroOrMore>\r
211     <element name="bar">\r
212       <empty/>\r
213     </element>\r
214   </group>\r
215 </element>\r
216 </correct>\r
217 <invalid>\r
218 <foo/>\r
219 </invalid>\r
220 <valid>\r
221 <foo>\r
222   <bar/>\r
223 </foo>\r
224 </valid>\r
225 <valid>\r
226 <foo>\r
227   <bar/>\r
228   <bar/>\r
229 </foo>\r
230 </valid>\r
231 <valid>\r
232 <foo>\r
233   <bar/>\r
234   <bar/>\r
235   <bar/>\r
236   <bar/>\r
237 </foo>\r
238 </valid>\r
239 </testCase>\r
240 <testCase>\r
241 <correct>\r
242 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
243   <choice>\r
244     <zeroOrMore>\r
245       <element name="bar">\r
246         <empty/>\r
247       </element>\r
248     </zeroOrMore>\r
249     <element name="baz">\r
250       <empty/>\r
251     </element>\r
252   </choice>\r
253 </element>\r
254 </correct>\r
255 <valid>\r
256 <foo/>\r
257 </valid>\r
258 <valid>\r
259 <foo>\r
260   <baz/>\r
261 </foo>\r
262 </valid>\r
263 <valid>\r
264 <foo>\r
265   <bar/>\r
266   <bar/>\r
267   <bar/>\r
268 </foo>\r
269 </valid>\r
270 <invalid>\r
271 <foo>\r
272   <bar/>\r
273   <baz/>\r
274 </foo>\r
275 </invalid>\r
276 <invalid>\r
277 <foo>\r
278   <bar/>\r
279   <bar/>\r
280   <bar/>\r
281   <bar/>\r
282   <baz/>\r
283 </foo>\r
284 </invalid>\r
285 </testCase>\r
286 <testCase>\r
287 <correct>\r
288 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
289   <choice>\r
290     <zeroOrMore>\r
291       <element name="bar">\r
292         <empty/>\r
293       </element>\r
294     </zeroOrMore>\r
295     <element name="baz">\r
296       <empty/>\r
297     </element>\r
298   </choice>\r
299   <element name="baz">\r
300     <empty/>\r
301   </element>\r
302 </element>\r
303 </correct>\r
304 <invalid>\r
305 <foo/>\r
306 </invalid>\r
307 <valid>\r
308 <foo>\r
309   <baz/>\r
310 </foo>\r
311 </valid>\r
312 <valid>\r
313 <foo>\r
314   <baz/>\r
315   <baz/>\r
316 </foo>\r
317 </valid>\r
318 <valid>\r
319 <foo>\r
320   <bar/>\r
321   <bar/>\r
322   <bar/>\r
323   <baz/>\r
324 </foo>\r
325 </valid>\r
326 <invalid>\r
327 <foo>\r
328   <bar/>\r
329   <baz/>\r
330   <baz/>\r
331 </foo>\r
332 </invalid>\r
333 <invalid>\r
334 <foo>\r
335   <baz/>\r
336   <bar/>\r
337   <baz/>\r
338 </foo>\r
339 </invalid>\r
340 </testCase>\r
341 <testCase>\r
342 <correct>\r
343 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
344   <choice>\r
345     <zeroOrMore>\r
346       <element name="bar">\r
347         <empty/>\r
348       </element>\r
349     </zeroOrMore>\r
350     <element name="bar">\r
351       <empty/>\r
352     </element>\r
353   </choice>\r
354 </element>\r
355 </correct>\r
356 <valid>\r
357 <foo/>\r
358 </valid>\r
359 <valid>\r
360 <foo>\r
361   <bar/>\r
362 </foo>\r
363 </valid>\r
364 <valid>\r
365 <foo>\r
366   <bar/>\r
367   <bar/>\r
368 </foo>\r
369 </valid>\r
370 <valid>\r
371 <foo>\r
372   <bar/>\r
373   <bar/>\r
374   <bar/>\r
375   <bar/>\r
376 </foo>\r
377 </valid>\r
378 </testCase>\r
379 <testCase>\r
380 <correct>\r
381 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
382   <choice>\r
383     <zeroOrMore>\r
384       <choice>\r
385         <element name="bar">\r
386           <empty/>\r
387         </element>\r
388         <element name="baz">\r
389           <empty/>\r
390         </element>\r
391       </choice>\r
392     </zeroOrMore>\r
393     <element name="bar">\r
394       <empty/>\r
395     </element>\r
396   </choice>\r
397 </element>\r
398 </correct>\r
399 <valid>\r
400 <foo/>\r
401 </valid>\r
402 <valid>\r
403 <foo>\r
404   <bar/>\r
405 </foo>\r
406 </valid>\r
407 <valid>\r
408 <foo>\r
409   <baz/>\r
410   <bar/>\r
411 </foo>\r
412 </valid>\r
413 <valid>\r
414 <foo>\r
415   <bar/>\r
416   <bar/>\r
417   <bar/>\r
418   <bar/>\r
419 </foo>\r
420 </valid>\r
421 <valid>\r
422 <foo>\r
423   <baz/>\r
424   <baz/>\r
425   <baz/>\r
426   <baz/>\r
427 </foo>\r
428 </valid>\r
429 <valid>\r
430 <foo>\r
431   <baz/>\r
432   <bar/>\r
433   <baz/>\r
434   <bar/>\r
435 </foo>\r
436 </valid>\r
437 </testCase>\r
438 <testCase>\r
439 <correct>\r
440 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
441   <optional>\r
442     <element name="bar">\r
443       <empty/>\r
444     </element>\r
445   </optional>\r
446   <element name="baz">\r
447     <empty/>\r
448   </element>\r
449 </element>\r
450 </correct>\r
451 <invalid>\r
452 <foo/>\r
453 </invalid>\r
454 <valid>\r
455 <foo>\r
456   <baz/>\r
457 </foo>\r
458 </valid>\r
459 <valid>\r
460 <foo>\r
461   <bar/>\r
462   <baz/>\r
463 </foo>\r
464 </valid>\r
465 <invalid>\r
466 <foo>\r
467   <bar/>\r
468   <bar/>\r
469   <baz/>\r
470 </foo>\r
471 </invalid>\r
472 </testCase>\r
473 <testCase>\r
474 <correct>\r
475 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
476   <optional>\r
477     <element name="bar">\r
478       <empty/>\r
479     </element>\r
480   </optional>\r
481   <element name="bar">\r
482     <empty/>\r
483   </element>\r
484 </element>\r
485 </correct>\r
486 <invalid>\r
487 <foo/>\r
488 </invalid>\r
489 <valid>\r
490 <foo>\r
491   <bar/>\r
492 </foo>\r
493 </valid>\r
494 <valid>\r
495 <foo>\r
496   <bar/>\r
497   <bar/>\r
498 </foo>\r
499 </valid>\r
500 <invalid>\r
501 <foo>\r
502   <bar/>\r
503   <bar/>\r
504   <bar/>\r
505 </foo>\r
506 </invalid>\r
507 </testCase>\r
508 <testCase>\r
509 <correct>\r
510 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
511   <optional>\r
512     <oneOrMore>\r
513       <element name="bar">\r
514         <empty/>\r
515       </element>\r
516     </oneOrMore>\r
517   </optional>\r
518   <element name="baz">\r
519     <empty/>\r
520   </element>\r
521 </element>\r
522 </correct>\r
523 <invalid>\r
524 <foo/>\r
525 </invalid>\r
526 <valid>\r
527 <foo>\r
528   <baz/>\r
529 </foo>\r
530 </valid>\r
531 <valid>\r
532 <foo>\r
533   <bar/>\r
534   <baz/>\r
535 </foo>\r
536 </valid>\r
537 <valid>\r
538 <foo>\r
539   <bar/>\r
540   <bar/>\r
541   <baz/>\r
542 </foo>\r
543 </valid>\r
544 <invalid>\r
545 <foo>\r
546   <bar/>\r
547   <bar/>\r
548 </foo>\r
549 </invalid>\r
550 </testCase>\r
551 <testCase>\r
552 <correct>\r
553 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
554   <optional>\r
555     <oneOrMore>\r
556       <element name="bar">\r
557         <empty/>\r
558       </element>\r
559     </oneOrMore>\r
560   </optional>\r
561   <element name="bar">\r
562     <empty/>\r
563   </element>\r
564 </element>\r
565 </correct>\r
566 <invalid>\r
567 <foo/>\r
568 </invalid>\r
569 <valid>\r
570 <foo>\r
571   <bar/>\r
572 </foo>\r
573 </valid>\r
574 <valid>\r
575 <foo>\r
576   <bar/>\r
577   <bar/>\r
578 </foo>\r
579 </valid>\r
580 <valid>\r
581 <foo>\r
582   <bar/>\r
583   <bar/>\r
584   <bar/>\r
585 </foo>\r
586 </valid>\r
587 </testCase>\r
588 <testCase>\r
589 <correct>\r
590 <element name="foo" xmlns="http://relaxng.org/ns/structure/1.0">\r
591   <group>\r
592     <zeroOrMore>\r
593       <choice>\r
594         <element name="bar">\r
595           <empty/>\r
596         </element>\r
597         <element name="baz">\r
598           <empty/>\r
599         </element>\r
600       </choice>\r
601     </zeroOrMore>\r
602     <element name="bar">\r
603       <empty/>\r
604     </element>\r
605   </group>\r
606 </element>\r
607 </correct>\r
608 <invalid>\r
609 <foo/>\r
610 </invalid>\r
611 <valid>\r
612 <foo>\r
613   <bar/>\r
614 </foo>\r
615 </valid>\r
616 <valid>\r
617 <foo>\r
618   <baz/>\r
619   <bar/>\r
620 </foo>\r
621 </valid>\r
622 <valid>\r
623 <foo>\r
624   <bar/>\r
625   <bar/>\r
626   <bar/>\r
627   <bar/>\r
628 </foo>\r
629 </valid>\r
630 <valid>\r
631 <foo>\r
632   <baz/>\r
633   <baz/>\r
634   <baz/>\r
635   <bar/>\r
636 </foo>\r
637 </valid>\r
638 <valid>\r
639 <foo>\r
640   <baz/>\r
641   <bar/>\r
642   <baz/>\r
643   <bar/>\r
644 </foo>\r
645 </valid>\r
646 <invalid>\r
647 <foo>\r
648   <bar/>\r
649   <baz/>\r
650   <bar/>\r
651   <baz/>\r
652 </foo>\r
653 </invalid>\r
654 </testCase>\r
655 <testCase>\r
656 <correct>\r
657 <element name="list" xmlns="http://relaxng.org/ns/structure/1.0">\r
658   <oneOrMore>\r
659     <element name="label">\r
660       <empty/>\r
661     </element>\r
662     <optional>\r
663       <element name="opt">\r
664         <empty/>\r
665       </element>\r
666     </optional>\r
667     <element name="item">\r
668       <empty/>\r
669     </element>\r
670   </oneOrMore>\r
671 </element>\r
672 </correct>\r
673 <invalid>\r
674 <list>\r
675 </list>\r
676 </invalid>\r
677 <valid>\r
678 <list>\r
679   <label/>\r
680   <item/>\r
681 </list>\r
682 </valid>\r
683 <valid>\r
684 <list>\r
685   <label/>\r
686   <item/>\r
687   <label/>\r
688   <item/>\r
689 </list>\r
690 </valid>\r
691 <valid>\r
692 <list>\r
693   <label/>\r
694   <opt/>\r
695   <item/>\r
696   <label/>\r
697   <opt/>\r
698   <item/>\r
699 </list>\r
700 </valid>\r
701 <invalid>\r
702 <list>\r
703   <label/>\r
704   <item/>\r
705   <label/>\r
706   <opt/>\r
707   <opt/>\r
708   <item/>\r
709 </list>\r
710 </invalid>\r
711 </testCase>\r
712 <testCase>\r
713 <correct>\r
714 <element name="list" xmlns="http://relaxng.org/ns/structure/1.0">\r
715   <oneOrMore>\r
716     <element name="label">\r
717       <empty/>\r
718     </element>\r
719     <zeroOrMore>\r
720       <element name="opt">\r
721         <empty/>\r
722       </element>\r
723     </zeroOrMore>\r
724     <element name="item">\r
725       <empty/>\r
726     </element>\r
727   </oneOrMore>\r
728 </element>\r
729 </correct>\r
730 <invalid>\r
731 <list>\r
732 </list>\r
733 </invalid>\r
734 <valid>\r
735 <list>\r
736   <label/>\r
737   <item/>\r
738 </list>\r
739 </valid>\r
740 <valid>\r
741 <list>\r
742   <label/>\r
743   <item/>\r
744   <label/>\r
745   <item/>\r
746 </list>\r
747 </valid>\r
748 <valid>\r
749 <list>\r
750   <label/>\r
751   <opt/>\r
752   <item/>\r
753   <label/>\r
754   <opt/>\r
755   <item/>\r
756 </list>\r
757 </valid>\r
758 <valid>\r
759 <list>\r
760   <label/>\r
761   <item/>\r
762   <label/>\r
763   <opt/>\r
764   <opt/>\r
765   <item/>\r
766 </list>\r
767 </valid>\r
768 </testCase>\r
769 <testCase>\r
770 <correct>\r
771 <element name="list" xmlns="http://relaxng.org/ns/structure/1.0">\r
772   <oneOrMore>\r
773     <element name="label">\r
774       <empty/>\r
775     </element>\r
776     <zeroOrMore>\r
777       <element name="opt">\r
778         <empty/>\r
779       </element>\r
780       <element name="opt2">\r
781         <empty/>\r
782       </element>\r
783     </zeroOrMore>\r
784     <element name="item">\r
785       <empty/>\r
786     </element>\r
787   </oneOrMore>\r
788 </element>\r
789 </correct>\r
790 <invalid>\r
791 <list>\r
792 </list>\r
793 </invalid>\r
794 <valid>\r
795 <list>\r
796   <label/>\r
797   <item/>\r
798 </list>\r
799 </valid>\r
800 <valid>\r
801 <list>\r
802   <label/>\r
803   <item/>\r
804   <label/>\r
805   <item/>\r
806 </list>\r
807 </valid>\r
808 <valid>\r
809 <list>\r
810   <label/>\r
811   <opt/>\r
812   <opt2/>\r
813   <item/>\r
814   <label/>\r
815   <opt/>\r
816   <opt2/>\r
817   <item/>\r
818 </list>\r
819 </valid>\r
820 <valid>\r
821 <list>\r
822   <label/>\r
823   <item/>\r
824   <label/>\r
825   <opt/>\r
826   <opt2/>\r
827   <opt/>\r
828   <opt2/>\r
829   <item/>\r
830 </list>\r
831 </valid>\r
832 <invalid>\r
833 <list>\r
834   <label/>\r
835   <opt/>\r
836   <item/>\r
837   <label/>\r
838   <item/>\r
839 </list>\r
840 </invalid>\r
841 <invalid>\r
842 <list>\r
843   <label/>\r
844   <item/>\r
845   <label/>\r
846   <opt2/>\r
847   <opt/>\r
848   <item/>\r
849 </list>\r
850 </invalid>\r
851 <invalid>\r
852 <list>\r
853   <label/>\r
854   <item/>\r
855   <label/>\r
856   <opt/>\r
857   <opt2/>\r
858   <opt/>\r
859   <item/>\r
860 </list>\r
861 </invalid>\r
862 </testCase>\r
863 </testSuite>\r
864 <testSuite>\r
865 <documentation>Test of grammars merging</documentation>\r
866 <testCase>\r
867 <resource name="dbk.rng">\r
868 <grammar xmlns="http://relaxng.org/ns/structure/1.0">\r
869   <start>\r
870     <ref name="p"/>\r
871   </start>\r
872   <define name="p.ext">\r
873     <notAllowed/>\r
874   </define>\r
875   <define name="p">\r
876     <element name="p">\r
877       <choice>\r
878         <ref name="p.ext"/>\r
879         <empty/>\r
880         <element name="a">\r
881           <text/>\r
882         </element>\r
883       </choice>\r
884     </element>\r
885   </define>\r
886 </grammar>\r
887 </resource>\r
888 <correct>\r
889 <grammar xmlns="http://relaxng.org/ns/structure/1.0">\r
890   <start>\r
891     <grammar>\r
892       <include href="dbk.rng"/>\r
893       <define name="p.ext" combine="choice">\r
894         <element name="b">\r
895           <text/>\r
896         </element>\r
897       </define>\r
898     </grammar>\r
899   </start>\r
900 </grammar>\r
901 </correct>\r
902 <valid>\r
903 <p/>\r
904 </valid>\r
905 <valid>\r
906 <p>\r
907   <a/>\r
908 </p>\r
909 </valid>\r
910 <valid>\r
911 <p>\r
912   <b/>\r
913 </p>\r
914 </valid>\r
915 <invalid>\r
916 <b/>\r
917 </invalid>\r
918 <invalid>\r
919 <p>\r
920   <b/>\r
921   <b/>\r
922 </p>\r
923 </invalid>\r
924 </testCase>\r
925 <testCase>\r
926 <resource name="dbk.rng">\r
927 <grammar xmlns="http://relaxng.org/ns/structure/1.0">\r
928   <start>\r
929     <ref name="p"/>\r
930   </start>\r
931   <define name="p.ext">\r
932     <notAllowed/>\r
933   </define>\r
934   <define name="p">\r
935     <element name="p">\r
936       <choice>\r
937         <ref name="p.ext"/>\r
938         <empty/>\r
939         <element name="a">\r
940           <text/>\r
941         </element>\r
942       </choice>\r
943     </element>\r
944   </define>\r
945   <define name="c">\r
946     <element name="c">\r
947       <empty/>\r
948     </element>\r
949   </define>\r
950 </grammar>\r
951 </resource>\r
952 <correct>\r
953 <grammar xmlns="http://relaxng.org/ns/structure/1.0">\r
954   <start>\r
955     <grammar>\r
956       <include href="dbk.rng"/>\r
957       <define name="p.ext" combine="choice">\r
958         <choice>\r
959           <ref name="c"/>\r
960           <parentRef name="d"/>\r
961           <element name="b">\r
962             <text/>\r
963           </element>\r
964         </choice>\r
965       </define>\r
966     </grammar>\r
967   </start>\r
968   <define name="d">\r
969     <element name="d">\r
970       <empty/>\r
971     </element>\r
972   </define>\r
973 </grammar>\r
974 </correct>\r
975 <valid>\r
976 <p/>\r
977 </valid>\r
978 <valid>\r
979 <p>\r
980   <a/>\r
981 </p>\r
982 </valid>\r
983 <valid>\r
984 <p>\r
985   <b/>\r
986 </p>\r
987 </valid>\r
988 <valid>\r
989 <p>\r
990   <c/>\r
991 </p>\r
992 </valid>\r
993 <valid>\r
994 <p>\r
995   <d/>\r
996 </p>\r
997 </valid>\r
998 <invalid>\r
999 <b/>\r
1000 </invalid>\r
1001 <invalid>\r
1002 <c/>\r
1003 </invalid>\r
1004 <invalid>\r
1005 <d/>\r
1006 </invalid>\r
1007 <invalid>\r
1008 <p>\r
1009   <b/>\r
1010   <c/>\r
1011 </p>\r
1012 </invalid>\r
1013 <invalid>\r
1014 <p>\r
1015   <d/>\r
1016   <c/>\r
1017 </p>\r
1018 </invalid>\r
1019 </testCase>\r
1020 <testCase>\r
1021 <resource name="dbk.rng">\r
1022 <grammar xmlns="http://relaxng.org/ns/structure/1.0">\r
1023   <start>\r
1024     <ref name="p"/>\r
1025   </start>\r
1026   <define name="p.ext">\r
1027     <notAllowed/>\r
1028   </define>\r
1029   <define name="p">\r
1030     <element name="p">\r
1031       <choice>\r
1032         <ref name="p.ext"/>\r
1033         <empty/>\r
1034         <element name="a">\r
1035           <text/>\r
1036         </element>\r
1037       </choice>\r
1038     </element>\r
1039   </define>\r
1040   <define name="c">\r
1041     <element name="c">\r
1042       <empty/>\r
1043     </element>\r
1044   </define>\r
1045 </grammar>\r
1046 </resource>\r
1047 <resource name="proof.rng">\r
1048 <grammar xmlns="http://relaxng.org/ns/structure/1.0">\r
1049   <start>\r
1050     <ref name="e"/>\r
1051   </start>\r
1052   <define name="d">\r
1053     <element name="d">\r
1054       <empty/>\r
1055     </element>\r
1056   </define>\r
1057   <define name="e">\r
1058     <element name="e">\r
1059       <empty/>\r
1060     </element>\r
1061   </define>\r
1062   <define name="f">\r
1063     <element name="f">\r
1064       <empty/>\r
1065     </element>\r
1066   </define>\r
1067 </grammar>\r
1068 </resource>\r
1069 <correct>\r
1070 <grammar xmlns="http://relaxng.org/ns/structure/1.0">\r
1071   <start>\r
1072     <grammar>\r
1073       <include href="dbk.rng"/>\r
1074       <define name="p.ext" combine="choice">\r
1075         <choice>\r
1076           <ref name="c"/>\r
1077           <grammar>\r
1078             <include href="proof.rng"/>\r
1079             <start combine="choice">\r
1080               <ref name="d"/>\r
1081             </start>\r
1082           </grammar>\r
1083           <element name="b">\r
1084             <text/>\r
1085           </element>\r
1086         </choice>\r
1087       </define>\r
1088     </grammar>\r
1089   </start>\r
1090   <define name="g">\r
1091     <element name="g">\r
1092       <empty/>\r
1093     </element>\r
1094   </define>\r
1095 </grammar>\r
1096 </correct>\r
1097 <valid>\r
1098 <p/>\r
1099 </valid>\r
1100 <valid>\r
1101 <p>\r
1102   <a/>\r
1103 </p>\r
1104 </valid>\r
1105 <valid>\r
1106 <p>\r
1107   <b/>\r
1108 </p>\r
1109 </valid>\r
1110 <valid>\r
1111 <p>\r
1112   <c/>\r
1113 </p>\r
1114 </valid>\r
1115 <valid>\r
1116 <p>\r
1117   <d/>\r
1118 </p>\r
1119 </valid>\r
1120 <valid>\r
1121 <p>\r
1122   <e/>\r
1123 </p>\r
1124 </valid>\r
1125 <invalid>\r
1126 <p>\r
1127   <f/>\r
1128 </p>\r
1129 </invalid>\r
1130 <invalid>\r
1131 <p>\r
1132   <g/>\r
1133 </p>\r
1134 </invalid>\r
1135 <invalid>\r
1136 <b/>\r
1137 </invalid>\r
1138 <invalid>\r
1139 <c/>\r
1140 </invalid>\r
1141 <invalid>\r
1142 <d/>\r
1143 </invalid>\r
1144 <invalid>\r
1145 <e/>\r
1146 </invalid>\r
1147 <invalid>\r
1148 <f/>\r
1149 </invalid>\r
1150 <invalid>\r
1151 <g/>\r
1152 </invalid>\r
1153 <invalid>\r
1154 <p>\r
1155   <d/>\r
1156   <c/>\r
1157 </p>\r
1158 </invalid>\r
1159 <invalid>\r
1160 <p>\r
1161   <d/>\r
1162   <e/>\r
1163 </p>\r
1164 </invalid>\r
1165 </testCase>\r
1166 <testCase>\r
1167 <resource name="dbk.rng">\r
1168 <grammar xmlns="http://relaxng.org/ns/structure/1.0">\r
1169   <start>\r
1170     <ref name="p"/>\r
1171   </start>\r
1172   <define name="p.ext">\r
1173     <notAllowed/>\r
1174   </define>\r
1175   <define name="p">\r
1176     <element name="p">\r
1177       <choice>\r
1178         <ref name="p.ext"/>\r
1179         <empty/>\r
1180         <element name="a">\r
1181           <text/>\r
1182         </element>\r
1183       </choice>\r
1184     </element>\r
1185   </define>\r
1186   <define name="c">\r
1187     <element name="c">\r
1188       <empty/>\r
1189     </element>\r
1190   </define>\r
1191 </grammar>\r
1192 </resource>\r
1193 <resource name="proof.rng">\r
1194 <grammar xmlns="http://relaxng.org/ns/structure/1.0"\r
1195          ns="http://example.org/ns/proofsystem">\r
1196   <start>\r
1197     <ref name="e"/>\r
1198   </start>\r
1199   <define name="d">\r
1200     <element name="d">\r
1201       <empty/>\r
1202     </element>\r
1203   </define>\r
1204   <define name="e">\r
1205     <element name="e">\r
1206       <empty/>\r
1207     </element>\r
1208   </define>\r
1209   <define name="f">\r
1210     <element name="f">\r
1211       <empty/>\r
1212     </element>\r
1213   </define>\r
1214 </grammar>\r
1215 </resource>\r
1216 <correct>\r
1217 <grammar xmlns="http://relaxng.org/ns/structure/1.0">\r
1218   <start>\r
1219     <grammar>\r
1220       <include href="dbk.rng"/>\r
1221       <define name="p.ext" combine="choice">\r
1222         <choice>\r
1223           <ref name="c"/>\r
1224           <grammar>\r
1225             <include href="proof.rng"/>\r
1226             <start combine="choice">\r
1227               <ref name="d"/>\r
1228             </start>\r
1229           </grammar>\r
1230           <element name="b">\r
1231             <text/>\r
1232           </element>\r
1233         </choice>\r
1234       </define>\r
1235     </grammar>\r
1236   </start>\r
1237   <define name="g">\r
1238     <element name="g">\r
1239       <empty/>\r
1240     </element>\r
1241   </define>\r
1242 </grammar>\r
1243 </correct>\r
1244 <valid>\r
1245 <p/>\r
1246 </valid>\r
1247 <valid>\r
1248 <p>\r
1249   <a/>\r
1250 </p>\r
1251 </valid>\r
1252 <valid>\r
1253 <p>\r
1254   <b/>\r
1255 </p>\r
1256 </valid>\r
1257 <valid>\r
1258 <p>\r
1259   <c/>\r
1260 </p>\r
1261 </valid>\r
1262 <valid>\r
1263 <p xmlns:p="http://example.org/ns/proofsystem">\r
1264   <p:d/>\r
1265 </p>\r
1266 </valid>\r
1267 <invalid>\r
1268 <p>\r
1269   <d/>\r
1270 </p>\r
1271 </invalid>\r
1272 <valid>\r
1273 <p xmlns:p="http://example.org/ns/proofsystem">\r
1274   <p:e/>\r
1275 </p>\r
1276 </valid>\r
1277 <invalid>\r
1278 <p>\r
1279   <e/>\r
1280 </p>\r
1281 </invalid>\r
1282 <invalid>\r
1283 <p xmlns:p="http://example.org/ns/proofsystem">\r
1284   <p:f/>\r
1285 </p>\r
1286 </invalid>\r
1287 <invalid>\r
1288 <p>\r
1289   <f/>\r
1290 </p>\r
1291 </invalid>\r
1292 <invalid>\r
1293 <p>\r
1294   <g/>\r
1295 </p>\r
1296 </invalid>\r
1297 <invalid>\r
1298 <b/>\r
1299 </invalid>\r
1300 <invalid>\r
1301 <c/>\r
1302 </invalid>\r
1303 <invalid>\r
1304 <d/>\r
1305 </invalid>\r
1306 <invalid>\r
1307 <e/>\r
1308 </invalid>\r
1309 <invalid>\r
1310 <f/>\r
1311 </invalid>\r
1312 <invalid>\r
1313 <g/>\r
1314 </invalid>\r
1315 <invalid>\r
1316 <p xmlns:p="http://example.org/ns/proofsystem">\r
1317   <p:d/>\r
1318   <c/>\r
1319 </p>\r
1320 </invalid>\r
1321 <invalid>\r
1322 <p xmlns:p="http://example.org/ns/proofsystem">\r
1323   <p:d/>\r
1324   <p:e/>\r
1325 </p>\r
1326 </invalid>\r
1327 </testCase>\r
1328 <testCase>\r
1329 <resource name="ext.rng">\r
1330 <grammar xmlns="http://relaxng.org/ns/structure/1.0">\r
1331   <start>\r
1332     <ref name="p"/>\r
1333   </start>\r
1334   <define name="p">\r
1335     <element name="p">\r
1336       <empty/>\r
1337     </element>\r
1338   </define>\r
1339 </grammar>\r
1340 </resource>\r
1341 <correct>\r
1342 <grammar xmlns="http://relaxng.org/ns/structure/1.0">\r
1343   <start>\r
1344     <element name="top">\r
1345       <choice>\r
1346         <ref name="include1"/>\r
1347         <ref name="include2"/>\r
1348       </choice>\r
1349     </element>\r
1350   </start>\r
1351   <define name="include1">\r
1352     <grammar>\r
1353       <include href="ext.rng">\r
1354         <start>\r
1355          <element name="a">\r
1356            <choice>\r
1357              <empty/>\r
1358              <ref name="p"/>\r
1359            </choice>\r
1360          </element>\r
1361         </start>\r
1362       </include>\r
1363     </grammar>\r
1364   </define>\r
1365   <define name="include2">\r
1366     <grammar>\r
1367       <include href="ext.rng">\r
1368         <start>\r
1369          <element name="b">\r
1370            <choice>\r
1371              <empty/>\r
1372              <ref name="p"/>\r
1373            </choice>\r
1374          </element>\r
1375         </start>\r
1376       </include>\r
1377     </grammar>\r
1378   </define>\r
1379 </grammar>\r
1380 </correct>\r
1381 <invalid>\r
1382 <top/>\r
1383 </invalid>\r
1384 <invalid>\r
1385 <a/>\r
1386 </invalid>\r
1387 <invalid>\r
1388 <b/>\r
1389 </invalid>\r
1390 <invalid>\r
1391 <p/>\r
1392 </invalid>\r
1393 <valid>\r
1394 <top>\r
1395   <a/>\r
1396 </top>\r
1397 </valid>\r
1398 <valid>\r
1399 <top>\r
1400   <b/>\r
1401 </top>\r
1402 </valid>\r
1403 <valid>\r
1404 <top>\r
1405   <a>\r
1406     <p/>\r
1407   </a>\r
1408 </top>\r
1409 </valid>\r
1410 <valid>\r
1411 <top>\r
1412   <b>\r
1413     <p/>\r
1414   </b>\r
1415 </top>\r
1416 </valid>\r
1417 </testCase>\r
1418 </testSuite>\r
1419 <testSuite>\r
1420 <documentation>Test of ID/IDREF</documentation>\r
1421 <testCase>\r
1422 <correct>\r
1423 <element name="top" xmlns="http://relaxng.org/ns/structure/1.0"\r
1424          datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">\r
1425   <zeroOrMore>\r
1426     <choice>\r
1427       <element name="ref">\r
1428         <attribute name="id">\r
1429           <data type="ID"/>\r
1430         </attribute>\r
1431         <text/>\r
1432       </element>\r
1433       <element name="xref">\r
1434         <attribute name="link">\r
1435           <data type="IDREF"/>\r
1436         </attribute>\r
1437         <text/>\r
1438       </element>\r
1439     </choice>\r
1440   </zeroOrMore>\r
1441 </element>\r
1442 </correct>\r
1443 <valid>\r
1444 <top>\r
1445 </top>\r
1446 </valid>\r
1447 <invalid>\r
1448 <top>\r
1449   <xref link="id1"/>\r
1450 </top>\r
1451 </invalid>\r
1452 <valid>\r
1453 <top>\r
1454   <ref id="id1"/>\r
1455 </top>\r
1456 </valid>\r
1457 <valid>\r
1458 <top>\r
1459   <xref link="id1"/>\r
1460   <ref id="id1"/>\r
1461 </top>\r
1462 </valid>\r
1463 <valid>\r
1464 <top>\r
1465   <xref link="  id1 "/>\r
1466   <ref id="     id1   "/>\r
1467   <xref link="id1 "/>\r
1468   <xref link="  id1"/>\r
1469 </top>\r
1470 </valid>\r
1471 <valid>\r
1472 <top>\r
1473   <ref id="id1"/>\r
1474   <xref link="id1"/>\r
1475 </top>\r
1476 </valid>\r
1477 <invalid>\r
1478 <top>\r
1479   <ref id="id1"/>\r
1480   <ref id="id1"/>\r
1481 </top>\r
1482 </invalid>\r
1483 </testCase>\r
1484 <testCase>\r
1485 <correct>\r
1486 <element name="top" xmlns="http://relaxng.org/ns/structure/1.0"\r
1487          datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">\r
1488   <zeroOrMore>\r
1489     <choice>\r
1490       <element name="ref">\r
1491         <attribute name="id">\r
1492           <data type="ID"/>\r
1493         </attribute>\r
1494         <text/>\r
1495       </element>\r
1496       <element name="xref">\r
1497         <attribute name="link">\r
1498           <data type="IDREFS"/>\r
1499         </attribute>\r
1500         <text/>\r
1501       </element>\r
1502     </choice>\r
1503   </zeroOrMore>\r
1504 </element>\r
1505 </correct>\r
1506 <valid>\r
1507 <top>\r
1508 </top>\r
1509 </valid>\r
1510 <invalid>\r
1511 <top>\r
1512   <xref link="id1"/>\r
1513 </top>\r
1514 </invalid>\r
1515 <valid>\r
1516 <top>\r
1517   <ref id="id1"/>\r
1518 </top>\r
1519 </valid>\r
1520 <valid>\r
1521 <top>\r
1522   <xref link="id1"/>\r
1523   <ref id="id1"/>\r
1524 </top>\r
1525 </valid>\r
1526 <valid>\r
1527 <top>\r
1528   <xref link="id1 id1"/>\r
1529   <ref id="id1"/>\r
1530 </top>\r
1531 </valid>\r
1532 <valid>\r
1533 <top>\r
1534   <ref id="id1"/>\r
1535   <xref link="id1"/>\r
1536 </top>\r
1537 </valid>\r
1538 <valid>\r
1539 <top>\r
1540   <ref id="id2"/>\r
1541   <xref link="id1 id2"/>\r
1542   <ref id="id1"/>\r
1543 </top>\r
1544 </valid>\r
1545 <valid>\r
1546 <top>\r
1547   <ref id="id2"/>\r
1548   <xref link=" id2    id1   id2 "/>\r
1549   <ref id="id1"/>\r
1550 </top>\r
1551 </valid>\r
1552 <invalid>\r
1553 <top>\r
1554   <ref id="id2"/>\r
1555   <xref link="id1 id2"/>\r
1556 </top>\r
1557 </invalid>\r
1558 <invalid>\r
1559 <top>\r
1560   <xref link="id1 id2"/>\r
1561   <ref id="id1"/>\r
1562 </top>\r
1563 </invalid>\r
1564 <invalid>\r
1565 <top>\r
1566   <ref id="id1"/>\r
1567   <ref id="id1"/>\r
1568 </top>\r
1569 </invalid>\r
1570 </testCase>\r
1571 </testSuite>\r
1572 <testSuite>\r
1573 <documentation>Test of ENTITY/ENTITIES</documentation>\r
1574 <testCase>\r
1575 <correct>\r
1576 <element xmlns="http://relaxng.org/ns/structure/1.0" name="doc" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">\r
1577   <data type="ENTITY"/>\r
1578 </element>\r
1579 </correct>\r
1580 <invalid>\r
1581 <doc></doc>\r
1582 </invalid>\r
1583 <invalid>\r
1584 <doc>foo</doc>\r
1585 </invalid>\r
1586 <valid dtd="&#10;&lt;!DOCTYPE doc [&#10;&lt;!ENTITY foo SYSTEM 'whatever' NDATA jpeg&gt;&#10;]&gt;">\r
1587 <doc>foo</doc>\r
1588 </valid>\r
1589 <valid dtd="&#10;&lt;!DOCTYPE doc [&#10;&lt;!ENTITY foo SYSTEM 'whatever' NDATA jpeg&gt;&#10;]&gt;">\r
1590 <doc>  foo </doc>\r
1591 </valid>\r
1592 <invalid dtd="&#10;&lt;!DOCTYPE doc [&#10;&lt;!ENTITY foo SYSTEM 'whatever' NDATA jpeg&gt;&#10;]&gt;">\r
1593 <doc>foo bar</doc>\r
1594 </invalid>\r
1595 </testCase>\r
1596 <testCase>\r
1597 <correct>\r
1598 <element xmlns="http://relaxng.org/ns/structure/1.0" name="doc" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">\r
1599   <data type="ENTITIES"/>\r
1600 </element>\r
1601 </correct>\r
1602 <invalid>\r
1603 <doc></doc>\r
1604 </invalid>\r
1605 <invalid>\r
1606 <doc>foo</doc>\r
1607 </invalid>\r
1608 <valid dtd="&#10;&lt;!DOCTYPE doc [&#10;&lt;!ENTITY foo SYSTEM 'whatever' NDATA jpeg&gt; &#10;&lt;!ENTITY bar SYSTEM 'whatever' NDATA jpeg&gt; &#10;]&gt;">\r
1609 <doc> foo bar </doc>\r
1610 </valid>\r
1611 <valid dtd="&#10;&lt;!DOCTYPE doc [&#10;&lt;!ENTITY foo SYSTEM 'whatever' NDATA jpeg&gt; &#10;&lt;!ENTITY bar SYSTEM 'whatever' NDATA jpeg&gt; &#10;]&gt;">\r
1612 <doc> foo bar foo</doc>\r
1613 </valid>\r
1614 <invalid dtd="&#10;&lt;!DOCTYPE doc [&#10;&lt;!ENTITY foo SYSTEM 'whatever' NDATA jpeg&gt;]&gt;">\r
1615 <doc>foo bar</doc>\r
1616 </invalid>\r
1617 </testCase>\r
1618 </testSuite>\r
1619 <testSuite>\r
1620 <documentation>Test of Mixed</documentation>\r
1621 <testCase>\r
1622 <correct>\r
1623 <element name="mix" xmlns="http://relaxng.org/ns/structure/1.0">\r
1624   <mixed>\r
1625     <zeroOrMore>\r
1626       <choice>\r
1627         <element name="a">\r
1628           <empty/>\r
1629         </element>\r
1630         <element name="b">\r
1631           <empty/>\r
1632         </element>\r
1633         <element name="c">\r
1634           <empty/>\r
1635         </element>\r
1636       </choice>\r
1637     </zeroOrMore>\r
1638   </mixed>\r
1639   <element name="d">\r
1640     <empty/>\r
1641   </element>\r
1642 </element>\r
1643 </correct>\r
1644 <valid>\r
1645 <mix>\r
1646   <d/>\r
1647 </mix>\r
1648 </valid>\r
1649 <valid>\r
1650 <mix>\r
1651   <b/>\r
1652   <a/>\r
1653   <c/>\r
1654   <b/>\r
1655   <d/>\r
1656 </mix>\r
1657 </valid>\r
1658 <valid>\r
1659 <mix>\r
1660   mixed\r
1661   <c/>\r
1662   <d/>\r
1663 </mix>\r
1664 </valid>\r
1665 <valid>\r
1666 <mix>\r
1667   <c/>\r
1668   mixed\r
1669   <d/>\r
1670 </mix>\r
1671 </valid>\r
1672 <valid>\r
1673 <mix>\r
1674   <b/>\r
1675   is\r
1676   <a/>\r
1677   inter\r
1678   <c/>\r
1679   mixed\r
1680   <b/>\r
1681   <d/>\r
1682 </mix>\r
1683 </valid>\r
1684 <valid>\r
1685 <mix>\r
1686   mixed\r
1687   <b/>\r
1688   .\r
1689   <d/>\r
1690 </mix>\r
1691 </valid>\r
1692 <valid>\r
1693 <mix>\r
1694   this\r
1695   <b/>\r
1696   is\r
1697   <a/>\r
1698   inter\r
1699   <c/>\r
1700   mixed\r
1701   <b/>\r
1702   .\r
1703   <d/>\r
1704 </mix>\r
1705 </valid>\r
1706 </testCase>\r
1707 </testSuite>\r
1708 </testSuite>\r