tutorA.rng 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334
  1. <grammar datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"
  2. ns="http://relaxng.org/ns/structure/1.0"
  3. xmlns="http://relaxng.org/ns/structure/1.0">
  4. <start>
  5. <ref name="pattern"/>
  6. </start>
  7. <define name="pattern">
  8. <choice>
  9. <element name="element">
  10. <choice>
  11. <attribute name="name">
  12. <data type="QName"/>
  13. </attribute>
  14. <ref name="open-name-class"/>
  15. </choice>
  16. <ref name="common-atts"/>
  17. <ref name="open-patterns"/>
  18. </element>
  19. <element name="attribute">
  20. <ref name="common-atts"/>
  21. <choice>
  22. <attribute name="name">
  23. <data type="QName"/>
  24. </attribute>
  25. <ref name="open-name-class"/>
  26. </choice>
  27. <interleave>
  28. <ref name="other"/>
  29. <optional>
  30. <ref name="pattern"/>
  31. </optional>
  32. </interleave>
  33. </element>
  34. <element name="group">
  35. <ref name="common-atts"/>
  36. <ref name="open-patterns"/>
  37. </element>
  38. <element name="interleave">
  39. <ref name="common-atts"/>
  40. <ref name="open-patterns"/>
  41. </element>
  42. <element name="choice">
  43. <ref name="common-atts"/>
  44. <ref name="open-patterns"/>
  45. </element>
  46. <element name="optional">
  47. <ref name="common-atts"/>
  48. <ref name="open-patterns"/>
  49. </element>
  50. <element name="zeroOrMore">
  51. <ref name="common-atts"/>
  52. <ref name="open-patterns"/>
  53. </element>
  54. <element name="oneOrMore">
  55. <ref name="common-atts"/>
  56. <ref name="open-patterns"/>
  57. </element>
  58. <element name="list">
  59. <ref name="common-atts"/>
  60. <ref name="open-patterns"/>
  61. </element>
  62. <element name="mixed">
  63. <ref name="common-atts"/>
  64. <ref name="open-patterns"/>
  65. </element>
  66. <element name="ref">
  67. <attribute name="name">
  68. <data type="NCName"/>
  69. </attribute>
  70. <ref name="common-atts"/>
  71. <ref name="other"/>
  72. </element>
  73. <element name="parentRef">
  74. <attribute name="name">
  75. <data type="NCName"/>
  76. </attribute>
  77. <ref name="common-atts"/>
  78. <ref name="other"/>
  79. </element>
  80. <element name="empty">
  81. <ref name="common-atts"/>
  82. <ref name="other"/>
  83. </element>
  84. <element name="text">
  85. <ref name="common-atts"/>
  86. <ref name="other"/>
  87. </element>
  88. <element name="value">
  89. <optional>
  90. <attribute name="type">
  91. <data type="NCName"/>
  92. </attribute>
  93. </optional>
  94. <ref name="common-atts"/>
  95. <text/>
  96. </element>
  97. <element name="data">
  98. <attribute name="type">
  99. <data type="NCName"/>
  100. </attribute>
  101. <ref name="common-atts"/>
  102. <interleave>
  103. <ref name="other"/>
  104. <group>
  105. <zeroOrMore>
  106. <element name="param">
  107. <attribute name="name">
  108. <data type="NCName"/>
  109. </attribute>
  110. <ref name="common-atts"/>
  111. <text/>
  112. </element>
  113. </zeroOrMore>
  114. <optional>
  115. <element name="except">
  116. <ref name="common-atts"/>
  117. <ref name="open-patterns"/>
  118. </element>
  119. </optional>
  120. </group>
  121. </interleave>
  122. </element>
  123. <element name="notAllowed">
  124. <ref name="common-atts"/>
  125. <ref name="other"/>
  126. </element>
  127. <element name="externalRef">
  128. <attribute name="href">
  129. <data type="anyURI"/>
  130. </attribute>
  131. <ref name="common-atts"/>
  132. <ref name="other"/>
  133. </element>
  134. <element name="grammar">
  135. <ref name="common-atts"/>
  136. <ref name="grammar-content"/>
  137. </element>
  138. </choice>
  139. </define>
  140. <define name="grammar-content">
  141. <interleave>
  142. <ref name="other"/>
  143. <zeroOrMore>
  144. <choice>
  145. <ref name="start-element"/>
  146. <ref name="define-element"/>
  147. <element name="div">
  148. <ref name="common-atts"/>
  149. <ref name="grammar-content"/>
  150. </element>
  151. <element name="include">
  152. <attribute name="href">
  153. <data type="anyURI"/>
  154. </attribute>
  155. <ref name="common-atts"/>
  156. <ref name="include-content"/>
  157. </element>
  158. </choice>
  159. </zeroOrMore>
  160. </interleave>
  161. </define>
  162. <define name="include-content">
  163. <interleave>
  164. <ref name="other"/>
  165. <zeroOrMore>
  166. <choice>
  167. <ref name="start-element"/>
  168. <ref name="define-element"/>
  169. <element name="div">
  170. <ref name="common-atts"/>
  171. <ref name="include-content"/>
  172. </element>
  173. </choice>
  174. </zeroOrMore>
  175. </interleave>
  176. </define>
  177. <define name="start-element">
  178. <element name="start">
  179. <ref name="combine-att"/>
  180. <ref name="common-atts"/>
  181. <ref name="open-pattern"/>
  182. </element>
  183. </define>
  184. <define name="define-element">
  185. <element name="define">
  186. <attribute name="name">
  187. <data type="NCName"/>
  188. </attribute>
  189. <ref name="combine-att"/>
  190. <ref name="common-atts"/>
  191. <ref name="open-patterns"/>
  192. </element>
  193. </define>
  194. <define name="combine-att">
  195. <optional>
  196. <attribute name="combine">
  197. <choice>
  198. <value>choice</value>
  199. <value>interleave</value>
  200. </choice>
  201. </attribute>
  202. </optional>
  203. </define>
  204. <define name="open-patterns">
  205. <interleave>
  206. <ref name="other"/>
  207. <oneOrMore>
  208. <ref name="pattern"/>
  209. </oneOrMore>
  210. </interleave>
  211. </define>
  212. <define name="open-pattern">
  213. <interleave>
  214. <ref name="other"/>
  215. <ref name="pattern"/>
  216. </interleave>
  217. </define>
  218. <define name="name-class">
  219. <choice>
  220. <element name="name">
  221. <ref name="common-atts"/>
  222. <data type="QName"/>
  223. </element>
  224. <element name="anyName">
  225. <ref name="common-atts"/>
  226. <ref name="except-name-class"/>
  227. </element>
  228. <element name="nsName">
  229. <ref name="common-atts"/>
  230. <ref name="except-name-class"/>
  231. </element>
  232. <element name="choice">
  233. <ref name="common-atts"/>
  234. <ref name="open-name-classes"/>
  235. </element>
  236. </choice>
  237. </define>
  238. <define name="except-name-class">
  239. <interleave>
  240. <ref name="other"/>
  241. <optional>
  242. <element name="except">
  243. <ref name="open-name-classes"/>
  244. </element>
  245. </optional>
  246. </interleave>
  247. </define>
  248. <define name="open-name-classes">
  249. <interleave>
  250. <ref name="other"/>
  251. <oneOrMore>
  252. <ref name="name-class"/>
  253. </oneOrMore>
  254. </interleave>
  255. </define>
  256. <define name="open-name-class">
  257. <interleave>
  258. <ref name="other"/>
  259. <ref name="name-class"/>
  260. </interleave>
  261. </define>
  262. <define name="common-atts">
  263. <optional>
  264. <attribute name="ns"/>
  265. </optional>
  266. <optional>
  267. <attribute name="datatypeLibrary">
  268. <data type="anyURI"/>
  269. </attribute>
  270. </optional>
  271. <zeroOrMore>
  272. <attribute>
  273. <anyName>
  274. <except>
  275. <nsName/>
  276. <nsName ns=""/>
  277. </except>
  278. </anyName>
  279. </attribute>
  280. </zeroOrMore>
  281. </define>
  282. <define name="other">
  283. <zeroOrMore>
  284. <element>
  285. <anyName>
  286. <except>
  287. <nsName/>
  288. </except>
  289. </anyName>
  290. <zeroOrMore>
  291. <choice>
  292. <attribute>
  293. <anyName/>
  294. </attribute>
  295. <text/>
  296. <ref name="any"/>
  297. </choice>
  298. </zeroOrMore>
  299. </element>
  300. </zeroOrMore>
  301. </define>
  302. <define name="any">
  303. <element>
  304. <anyName/>
  305. <zeroOrMore>
  306. <choice>
  307. <attribute>
  308. <anyName/>
  309. </attribute>
  310. <text/>
  311. <ref name="any"/>
  312. </choice>
  313. </zeroOrMore>
  314. </element>
  315. </define>
  316. </grammar>