imported DTD compatibility test suite
[cxml-rng-test.git] / dtd-split / testSuite.rng
blobb60294e0f596f17105eaff1060e91ab2addf0af5
1 <?xml version="1.0"?>
2 <!-- $Id: testSuite.rng,v 1.4 2001/09/19 23:41:24 Bear Exp $ -->
3 <grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="">
4 <!--
5 target namespace is intentionally set to "" so as not to interfere with
6 prefix/URI bindings
7 -->
9 <start>
10 <ref name="testSuite"/>
11 </start>
13 <define name="testSuite">
14 <!-- a test suite represents a set of tests -->
15 <element name="testSuite">
16 <ref name="header"/>
17 <oneOrMore>
18 <choice>
19 <!-- testSuites can be nested -->
20 <ref name="testSuite"/>
21 <!-- a single test case -->
22 <ref name="testCase"/>
23 <!--
24 resources are by itself a RELAX NG pattern, and it can be
25 referenced from other patterns through <externalRef/>
26 the scope of the resources are global.
27 -->
28 <element name="resource">
29 <attribute name="href">
30 <data type="token" key="moduleName" />
31 </attribute>
32 <ref name="anyElement"/>
33 </element>
34 </choice>
35 </oneOrMore>
36 </element>
37 </define>
39 <define name="testCase">
40 <element name="testCase">
41 <ref name="header"/>
43 <choice>
44 <!-- invalid patterns -->
45 <oneOrMore>
46 <element name="invalidPattern">
47 <ref name="anyElement"/>
48 </element>
49 </oneOrMore>
51 <!-- a valid pattern and test cases -->
52 <group>
53 <element name="validPattern">
54 <!-- the compatibility of this schema with various features -->
55 <optional>
56 <attribute name="annotation">
57 <ref name="ok.ng"/>
58 </attribute>
59 </optional>
60 <optional>
61 <attribute name="ididref">
62 <ref name="ok.ng"/>
63 </attribute>
64 </optional>
65 <optional>
66 <attribute name="defaultValue">
67 <ref name="ok.ng"/>
68 </attribute>
69 </optional>
71 <!-- pattern itself -->
72 <externalRef href="relaxng.rng"/>
73 </element>
75 <oneOrMore>
76 <choice>
77 <!-- valid test cases -->
78 <element name="valid">
79 <!-- the soundness of this document -->
80 <optional>
81 <attribute name="ididref">
82 <ref name="ok.ng"/>
83 </attribute>
84 </optional>
85 <ref name="anyElement"/>
86 </element>
87 <!-- invalid test cases -->
88 <element name="invalid">
89 <ref name="anyElement"/>
90 </element>
91 </choice>
92 </oneOrMore>
93 </group>
94 </choice>
95 </element>
96 </define>
98 <define name="ok.ng">
99 <choice>
100 <value>ok</value>
101 <value>ng</value>
102 </choice>
103 </define>
106 <define name="any">
107 <zeroOrMore>
108 <choice>
109 <ref name="anyElement"/>
110 <attribute>
111 <anyName/>
112 <text/>
113 </attribute>
114 <text/>
115 </choice>
116 </zeroOrMore>
117 </define>
119 <define name="anyElement">
120 <element>
121 <anyName/>
122 <ref name="any"/>
123 </element>
124 </define>
127 <!-- header is a place holder for meta-information -->
128 <define name="header">
129 <optional>
130 <element name="header">
131 <!-- this schema does not check the contents of headers -->
132 <zeroOrMore>
133 <ref name="anyElement"/>
134 </zeroOrMore>
135 </element>
136 </optional>
137 </define>
139 </grammar>