qandaset.rng 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. This file is part of DocBook V5.0
  4. Copyright 1992-2008 HaL Computer Systems, Inc.,
  5. O'Reilly & Associates, Inc., ArborText, Inc., Fujitsu Software
  6. Corporation, Norman Walsh, Sun Microsystems, Inc., and the
  7. Organization for the Advancement of Structured Information
  8. Standards (OASIS).
  9. Release: $Id: qandaset.rnc 8931 2010-10-20 13:29:20Z nwalsh $
  10. Permission to use, copy, modify and distribute the DocBook schema
  11. and its accompanying documentation for any purpose and without fee
  12. is hereby granted in perpetuity, provided that the above copyright
  13. notice and this paragraph appear in all copies. The copyright
  14. holders make no representation about the suitability of the schema
  15. for any purpose. It is provided "as is" without expressed or implied
  16. warranty.
  17. If you modify the DocBook schema in any way, label your schema as a
  18. variant of DocBook. See the reference documentation
  19. (http://docbook.org/tdg5/en/html/ch05.html#s-notdocbook)
  20. for more information.
  21. Please direct all questions, bug reports, or suggestions for changes
  22. to the docbook@lists.oasis-open.org mailing list. For more
  23. information, see http://www.oasis-open.org/docbook/.
  24. ======================================================================
  25. -->
  26. <grammar ns="http://docbook.org/ns/docbook" xmlns:db="http://docbook.org/ns/docbook" xmlns:s="http://purl.oclc.org/dsdl/schematron" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:rng="http://relaxng.org/ns/structure/1.0" xmlns:ctrl="http://nwalsh.com/xmlns/schema-control/" xmlns="http://relaxng.org/ns/structure/1.0">
  27. <start combine="choice">
  28. <choice>
  29. <ref name="db.qandadiv"/>
  30. <ref name="db.qandaentry"/>
  31. <ref name="db.qandaset"/>
  32. </choice>
  33. </start>
  34. <define name="db.list.blocks" combine="choice">
  35. <ref name="db.qandaset"/>
  36. </define>
  37. <!-- ====================================================================== -->
  38. <div>
  39. <db:refname>qandaset</db:refname>
  40. <db:refpurpose>A question-and-answer set</db:refpurpose>
  41. <define name="db.qandaset.role.attribute">
  42. <attribute name="role"/>
  43. </define>
  44. <define name="db.qandaset.defaultlabel.enumeration">
  45. <choice>
  46. <value>none</value>
  47. <a:documentation>No labels</a:documentation>
  48. <value>number</value>
  49. <a:documentation>Numeric labels</a:documentation>
  50. <value>qanda</value>
  51. <a:documentation>"Q:" and "A:" labels</a:documentation>
  52. </choice>
  53. </define>
  54. <define name="db.qandaset.defaultlabel.attribute">
  55. <attribute name="defaultlabel">
  56. <db:refpurpose>Specifies the default labelling</db:refpurpose>
  57. <ref name="db.qandaset.defaultlabel.enumeration"/>
  58. </attribute>
  59. </define>
  60. <define name="db.qandaset.attlist">
  61. <interleave>
  62. <optional>
  63. <ref name="db.qandaset.role.attribute"/>
  64. </optional>
  65. <ref name="db.common.attributes"/>
  66. <ref name="db.common.linking.attributes"/>
  67. <optional>
  68. <ref name="db.qandaset.defaultlabel.attribute"/>
  69. </optional>
  70. </interleave>
  71. </define>
  72. <define name="db.qandaset.info">
  73. <ref name="db._info.title.only"/>
  74. </define>
  75. <define name="db.qandaset">
  76. <element name="qandaset">
  77. <ref name="db.qandaset.attlist"/>
  78. <ref name="db.qandaset.info"/>
  79. <zeroOrMore>
  80. <ref name="db.all.blocks"/>
  81. </zeroOrMore>
  82. <choice>
  83. <oneOrMore>
  84. <ref name="db.qandadiv"/>
  85. </oneOrMore>
  86. <oneOrMore>
  87. <ref name="db.qandaentry"/>
  88. </oneOrMore>
  89. </choice>
  90. </element>
  91. </define>
  92. </div>
  93. <!-- ====================================================================== -->
  94. <div>
  95. <db:refname>qandadiv</db:refname>
  96. <db:refpurpose>A titled division in a qandaset</db:refpurpose>
  97. <define name="db.qandadiv.role.attribute">
  98. <attribute name="role"/>
  99. </define>
  100. <define name="db.qandadiv.attlist">
  101. <interleave>
  102. <optional>
  103. <ref name="db.qandadiv.role.attribute"/>
  104. </optional>
  105. <ref name="db.common.attributes"/>
  106. <ref name="db.common.linking.attributes"/>
  107. </interleave>
  108. </define>
  109. <define name="db.qandadiv.info">
  110. <ref name="db._info.title.only"/>
  111. </define>
  112. <define name="db.qandadiv">
  113. <element name="qandadiv">
  114. <ref name="db.qandadiv.attlist"/>
  115. <ref name="db.qandadiv.info"/>
  116. <zeroOrMore>
  117. <ref name="db.all.blocks"/>
  118. </zeroOrMore>
  119. <choice>
  120. <oneOrMore>
  121. <ref name="db.qandadiv"/>
  122. </oneOrMore>
  123. <oneOrMore>
  124. <ref name="db.qandaentry"/>
  125. </oneOrMore>
  126. </choice>
  127. </element>
  128. </define>
  129. </div>
  130. <!-- ====================================================================== -->
  131. <div>
  132. <db:refname>qandaentry</db:refname>
  133. <db:refpurpose>A question/answer set within a qandaset</db:refpurpose>
  134. <define name="db.qandaentry.role.attribute">
  135. <attribute name="role"/>
  136. </define>
  137. <define name="db.qandaentry.attlist">
  138. <interleave>
  139. <optional>
  140. <ref name="db.qandaentry.role.attribute"/>
  141. </optional>
  142. <ref name="db.common.attributes"/>
  143. <ref name="db.common.linking.attributes"/>
  144. </interleave>
  145. </define>
  146. <define name="db.qandaentry.info">
  147. <ref name="db._info.title.only"/>
  148. </define>
  149. <define name="db.qandaentry">
  150. <element name="qandaentry">
  151. <ref name="db.qandaentry.attlist"/>
  152. <ref name="db.qandaentry.info"/>
  153. <ref name="db.question"/>
  154. <zeroOrMore>
  155. <ref name="db.answer"/>
  156. </zeroOrMore>
  157. </element>
  158. </define>
  159. </div>
  160. <!-- ====================================================================== -->
  161. <div>
  162. <db:refname>question</db:refname>
  163. <db:refpurpose>A question in a qandaset</db:refpurpose>
  164. <define name="db.question.role.attribute">
  165. <attribute name="role"/>
  166. </define>
  167. <define name="db.question.attlist">
  168. <interleave>
  169. <optional>
  170. <ref name="db.question.role.attribute"/>
  171. </optional>
  172. <ref name="db.common.attributes"/>
  173. <ref name="db.common.linking.attributes"/>
  174. </interleave>
  175. </define>
  176. <define name="db.question">
  177. <element name="question">
  178. <ref name="db.question.attlist"/>
  179. <optional>
  180. <ref name="db.label"/>
  181. </optional>
  182. <oneOrMore>
  183. <ref name="db.all.blocks"/>
  184. </oneOrMore>
  185. </element>
  186. </define>
  187. </div>
  188. <!-- ====================================================================== -->
  189. <div>
  190. <db:refname>answer</db:refname>
  191. <db:refpurpose>An answer to a question posed in a qandaset</db:refpurpose>
  192. <define name="db.answer.role.attribute">
  193. <attribute name="role"/>
  194. </define>
  195. <define name="db.answer.attlist">
  196. <interleave>
  197. <optional>
  198. <ref name="db.answer.role.attribute"/>
  199. </optional>
  200. <ref name="db.common.attributes"/>
  201. <ref name="db.common.linking.attributes"/>
  202. </interleave>
  203. </define>
  204. <define name="db.answer">
  205. <element name="answer">
  206. <ref name="db.answer.attlist"/>
  207. <optional>
  208. <ref name="db.label"/>
  209. </optional>
  210. <oneOrMore>
  211. <ref name="db.all.blocks"/>
  212. </oneOrMore>
  213. </element>
  214. </define>
  215. </div>
  216. <!-- ====================================================================== -->
  217. <div>
  218. <db:refname>label</db:refname>
  219. <db:refpurpose>A label on a question or answer</db:refpurpose>
  220. <define name="db.label.role.attribute">
  221. <attribute name="role"/>
  222. </define>
  223. <define name="db.label.attlist">
  224. <interleave>
  225. <optional>
  226. <ref name="db.label.role.attribute"/>
  227. </optional>
  228. <ref name="db.common.attributes"/>
  229. <ref name="db.common.linking.attributes"/>
  230. </interleave>
  231. </define>
  232. <define name="db.label">
  233. <element name="label">
  234. <ref name="db.label.attlist"/>
  235. <ref name="db._text"/>
  236. </element>
  237. </define>
  238. </div>
  239. </grammar>