glossary.rng 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  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: glossary.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:rng="http://relaxng.org/ns/structure/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
  27. <start combine="choice">
  28. <choice>
  29. <ref name="db.glossary"/>
  30. <ref name="db.glossdiv"/>
  31. <ref name="db.glosslist"/>
  32. </choice>
  33. </start>
  34. <define name="db.publishing.inlines" combine="choice">
  35. <ref name="db.glossary.inlines"/>
  36. </define>
  37. <define name="db.list.blocks" combine="choice">
  38. <ref name="db.glosslist"/>
  39. </define>
  40. <define name="db.navigation.components" combine="choice">
  41. <ref name="db.glossary"/>
  42. </define>
  43. <define name="db.glossary.inlines">
  44. <choice>
  45. <ref name="db.firstterm"/>
  46. <ref name="db.glossterm"/>
  47. <ref name="db._firstterm"/>
  48. <ref name="db._glossterm"/>
  49. </choice>
  50. </define>
  51. <define name="db.ubiq.inlines" combine="choice">
  52. <choice>
  53. <ref name="db._firstterm"/>
  54. <ref name="db._glossterm"/>
  55. </choice>
  56. </define>
  57. <!-- ====================================================================== -->
  58. <define name="db.baseform.attribute">
  59. <optional>
  60. <attribute name="baseform">
  61. <db:refpurpose>Specifies the base form of the term, the one that appears in the glossary. This allows adjectival, plural, and other variations of the term to appear in the element. The element content is the default base form.</db:refpurpose>
  62. </attribute>
  63. </optional>
  64. </define>
  65. <!-- ====================================================================== -->
  66. <div>
  67. <db:refname>glosslist</db:refname>
  68. <db:refpurpose>A wrapper for a list of glossary entries</db:refpurpose>
  69. <define name="db.glosslist.role.attribute">
  70. <attribute name="role"/>
  71. </define>
  72. <define name="db.glosslist.attlist">
  73. <interleave>
  74. <optional>
  75. <ref name="db.glosslist.role.attribute"/>
  76. </optional>
  77. <ref name="db.common.attributes"/>
  78. <ref name="db.common.linking.attributes"/>
  79. </interleave>
  80. </define>
  81. <define name="db.glosslist.info">
  82. <ref name="db._info.title.only"/>
  83. </define>
  84. <define name="db.glosslist">
  85. <element name="glosslist">
  86. <ref name="db.glosslist.attlist"/>
  87. <optional>
  88. <ref name="db.glosslist.info"/>
  89. </optional>
  90. <zeroOrMore>
  91. <ref name="db.all.blocks"/>
  92. </zeroOrMore>
  93. <oneOrMore>
  94. <ref name="db.glossentry"/>
  95. </oneOrMore>
  96. </element>
  97. </define>
  98. </div>
  99. <!-- ====================================================================== -->
  100. <div>
  101. <db:refname>glossentry</db:refname>
  102. <db:refpurpose>An entry in a glossary or glosslist</db:refpurpose>
  103. <define name="db.glossentry.role.attribute">
  104. <attribute name="role"/>
  105. </define>
  106. <define name="db.glossentry.sortas.attribute">
  107. <attribute name="sortas">
  108. <db:refpurpose>Specifies the string by which the element's content is to be sorted; if unspecified, the content is used</db:refpurpose>
  109. </attribute>
  110. </define>
  111. <define name="db.glossentry.attlist">
  112. <interleave>
  113. <optional>
  114. <ref name="db.glossentry.role.attribute"/>
  115. </optional>
  116. <ref name="db.common.attributes"/>
  117. <ref name="db.common.linking.attributes"/>
  118. <optional>
  119. <ref name="db.glossentry.sortas.attribute"/>
  120. </optional>
  121. </interleave>
  122. </define>
  123. <define name="db.glossentry">
  124. <element name="glossentry">
  125. <ref name="db.glossentry.attlist"/>
  126. <ref name="db.glossterm"/>
  127. <optional>
  128. <ref name="db.acronym"/>
  129. </optional>
  130. <optional>
  131. <ref name="db.abbrev"/>
  132. </optional>
  133. <zeroOrMore>
  134. <ref name="db.indexterm"/>
  135. </zeroOrMore>
  136. <choice>
  137. <ref name="db.glosssee"/>
  138. <oneOrMore>
  139. <ref name="db.glossdef"/>
  140. </oneOrMore>
  141. </choice>
  142. </element>
  143. </define>
  144. </div>
  145. <!-- ====================================================================== -->
  146. <div>
  147. <db:refname>glossdef</db:refname>
  148. <db:refpurpose>A definition in a glossentry</db:refpurpose>
  149. <define name="db.glossdef.role.attribute">
  150. <attribute name="role"/>
  151. </define>
  152. <define name="db.glossdef.subject.attribute">
  153. <attribute name="subject">
  154. <db:refpurpose>Specifies a list of keywords for the definition</db:refpurpose>
  155. </attribute>
  156. </define>
  157. <define name="db.glossdef.attlist">
  158. <interleave>
  159. <optional>
  160. <ref name="db.glossdef.role.attribute"/>
  161. </optional>
  162. <ref name="db.common.attributes"/>
  163. <ref name="db.common.linking.attributes"/>
  164. <optional>
  165. <ref name="db.glossdef.subject.attribute"/>
  166. </optional>
  167. </interleave>
  168. </define>
  169. <define name="db.glossdef">
  170. <element name="glossdef">
  171. <ref name="db.glossdef.attlist"/>
  172. <oneOrMore>
  173. <ref name="db.all.blocks"/>
  174. </oneOrMore>
  175. <zeroOrMore>
  176. <ref name="db.glossseealso"/>
  177. </zeroOrMore>
  178. </element>
  179. </define>
  180. </div>
  181. <!-- ====================================================================== -->
  182. <div>
  183. <db:refname>glosssee</db:refname>
  184. <db:refpurpose>A cross-reference from one <db:tag>glossentry</db:tag>
  185. to another</db:refpurpose>
  186. <define name="db.glosssee.role.attribute">
  187. <attribute name="role"/>
  188. </define>
  189. <define name="db.glosssee.otherterm.attribute">
  190. <attribute name="otherterm">
  191. <db:refpurpose>Identifies the other term</db:refpurpose>
  192. <data type="IDREF"/>
  193. </attribute>
  194. </define>
  195. <define name="db.glosssee.attlist">
  196. <interleave>
  197. <optional>
  198. <ref name="db.glosssee.role.attribute"/>
  199. </optional>
  200. <ref name="db.common.attributes"/>
  201. <ref name="db.common.linking.attributes"/>
  202. <optional>
  203. <ref name="db.glosssee.otherterm.attribute"/>
  204. </optional>
  205. </interleave>
  206. </define>
  207. <define name="db.glosssee">
  208. <element name="glosssee">
  209. <s:pattern name="Glosssary 'see' type constraint">
  210. <s:rule context="db:glosssee[@otherterm]">
  211. <s:assert test="local-name(//*[@xml:id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'">@otherterm on glosssee must point to a glossentry.</s:assert>
  212. </s:rule>
  213. </s:pattern>
  214. <ref name="db.glosssee.attlist"/>
  215. <zeroOrMore>
  216. <ref name="db.all.inlines"/>
  217. </zeroOrMore>
  218. </element>
  219. </define>
  220. </div>
  221. <!-- ====================================================================== -->
  222. <div>
  223. <db:refname>glossseealso</db:refname>
  224. <db:refpurpose>A cross-reference from one glossentry to another</db:refpurpose>
  225. <define name="db.glossseealso.role.attribute">
  226. <attribute name="role"/>
  227. </define>
  228. <define name="db.glossseealso.otherterm.attribute">
  229. <attribute name="otherterm">
  230. <db:refpurpose>Identifies the other term</db:refpurpose>
  231. <data type="IDREF"/>
  232. </attribute>
  233. </define>
  234. <define name="db.glossseealso.attlist">
  235. <interleave>
  236. <optional>
  237. <ref name="db.glossseealso.role.attribute"/>
  238. </optional>
  239. <ref name="db.common.attributes"/>
  240. <ref name="db.common.linking.attributes"/>
  241. <optional>
  242. <ref name="db.glossseealso.otherterm.attribute"/>
  243. </optional>
  244. </interleave>
  245. </define>
  246. <define name="db.glossseealso">
  247. <element name="glossseealso">
  248. <s:pattern name="Glossary 'seealso' type constraint">
  249. <s:rule context="db:glossseealso[@otherterm]">
  250. <s:assert test="local-name(//*[@xml:id=current()/@otherterm]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@otherterm]) = 'http://docbook.org/ns/docbook'">@otherterm on glossseealso must point to a glossentry.</s:assert>
  251. </s:rule>
  252. </s:pattern>
  253. <ref name="db.glossseealso.attlist"/>
  254. <zeroOrMore>
  255. <ref name="db.all.inlines"/>
  256. </zeroOrMore>
  257. </element>
  258. </define>
  259. </div>
  260. <!-- ====================================================================== -->
  261. <div>
  262. <db:refname>firstterm</db:refname>
  263. <db:refpurpose>The first occurrence of a term</db:refpurpose>
  264. <define name="db.firstterm.role.attribute">
  265. <attribute name="role"/>
  266. </define>
  267. <define name="db.firstterm.attlist">
  268. <interleave>
  269. <optional>
  270. <ref name="db.firstterm.role.attribute"/>
  271. </optional>
  272. <ref name="db.common.attributes"/>
  273. <ref name="db.common.linking.attributes"/>
  274. <ref name="db.baseform.attribute"/>
  275. </interleave>
  276. </define>
  277. <define name="db.firstterm">
  278. <element name="firstterm">
  279. <s:pattern name="Glossary 'firstterm' type constraint">
  280. <s:rule context="db:firstterm[@linkend]">
  281. <s:assert test="local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'">@linkend on firstterm must point to a glossentry.</s:assert>
  282. </s:rule>
  283. </s:pattern>
  284. <ref name="db.firstterm.attlist"/>
  285. <zeroOrMore>
  286. <ref name="db.all.inlines"/>
  287. </zeroOrMore>
  288. </element>
  289. </define>
  290. </div>
  291. <!-- ====================================================================== -->
  292. <div>
  293. <db:refname>firstterm</db:refname>
  294. <db:refpurpose>The first occurrence of a term, with limited content</db:refpurpose>
  295. <define name="db._firstterm.role.attribute">
  296. <attribute name="role"/>
  297. </define>
  298. <define name="db._firstterm.attlist">
  299. <interleave>
  300. <optional>
  301. <ref name="db._firstterm.role.attribute"/>
  302. </optional>
  303. <ref name="db.common.attributes"/>
  304. <ref name="db.common.linking.attributes"/>
  305. <ref name="db.baseform.attribute"/>
  306. </interleave>
  307. </define>
  308. <define name="db._firstterm">
  309. <element name="firstterm">
  310. <s:pattern name="Glossary 'firstterm' type constraint">
  311. <s:rule context="db:firstterm[@linkend]">
  312. <s:assert test="local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'">@linkend on firstterm must point to a glossentry.</s:assert>
  313. </s:rule>
  314. </s:pattern>
  315. <ref name="db._firstterm.attlist"/>
  316. <ref name="db._text"/>
  317. </element>
  318. </define>
  319. </div>
  320. <!-- ====================================================================== -->
  321. <div>
  322. <db:refname>glossterm</db:refname>
  323. <db:refpurpose>A glossary term</db:refpurpose>
  324. <define name="db.glossterm.role.attribute">
  325. <attribute name="role"/>
  326. </define>
  327. <define name="db.glossterm.attlist">
  328. <interleave>
  329. <optional>
  330. <ref name="db.glossterm.role.attribute"/>
  331. </optional>
  332. <ref name="db.common.attributes"/>
  333. <ref name="db.common.linking.attributes"/>
  334. <ref name="db.baseform.attribute"/>
  335. </interleave>
  336. </define>
  337. <define name="db.glossterm">
  338. <element name="glossterm">
  339. <s:pattern name="Glossary 'glossterm' type constraint">
  340. <s:rule context="db:glossterm[@linkend]">
  341. <s:assert test="local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'">@linkend on glossterm must point to a glossentry.</s:assert>
  342. </s:rule>
  343. </s:pattern>
  344. <ref name="db.glossterm.attlist"/>
  345. <zeroOrMore>
  346. <ref name="db.all.inlines"/>
  347. </zeroOrMore>
  348. </element>
  349. </define>
  350. </div>
  351. <!-- ====================================================================== -->
  352. <div>
  353. <db:refname>glossterm</db:refname>
  354. <db:refpurpose>A glossary term</db:refpurpose>
  355. <define name="db._glossterm.role.attribute">
  356. <attribute name="role"/>
  357. </define>
  358. <define name="db._glossterm.attlist">
  359. <interleave>
  360. <optional>
  361. <ref name="db._glossterm.role.attribute"/>
  362. </optional>
  363. <ref name="db.common.attributes"/>
  364. <ref name="db.common.linking.attributes"/>
  365. <ref name="db.baseform.attribute"/>
  366. </interleave>
  367. </define>
  368. <define name="db._glossterm">
  369. <element name="glossterm">
  370. <s:pattern name="Glossary 'glossterm' type constraint">
  371. <s:rule context="db:glossterm[@linkend]">
  372. <s:assert test="local-name(//*[@xml:id=current()/@linkend]) = 'glossentry' and namespace-uri(//*[@xml:id=current()/@linkend]) = 'http://docbook.org/ns/docbook'">@linkend on glossterm must point to a glossentry.</s:assert>
  373. </s:rule>
  374. </s:pattern>
  375. <ref name="db._glossterm.attlist"/>
  376. <ref name="db._text"/>
  377. </element>
  378. </define>
  379. </div>
  380. <!-- ====================================================================== -->
  381. <div>
  382. <db:refname>glossary</db:refname>
  383. <db:refpurpose>A glossary</db:refpurpose>
  384. <define name="db.glossary.status.attribute">
  385. <ref name="db.status.attribute"/>
  386. </define>
  387. <define name="db.glossary.role.attribute">
  388. <attribute name="role"/>
  389. </define>
  390. <define name="db.glossary.attlist">
  391. <interleave>
  392. <optional>
  393. <ref name="db.glossary.role.attribute"/>
  394. </optional>
  395. <ref name="db.common.attributes"/>
  396. <ref name="db.common.linking.attributes"/>
  397. <optional>
  398. <ref name="db.label.attribute"/>
  399. </optional>
  400. <optional>
  401. <ref name="db.glossary.status.attribute"/>
  402. </optional>
  403. </interleave>
  404. </define>
  405. <define name="db.glossary.info">
  406. <ref name="db._info"/>
  407. </define>
  408. <define name="db.glossary">
  409. <element name="glossary">
  410. <ref name="db.glossary.attlist"/>
  411. <ref name="db.glossary.info"/>
  412. <zeroOrMore>
  413. <ref name="db.all.blocks"/>
  414. </zeroOrMore>
  415. <choice>
  416. <zeroOrMore>
  417. <ref name="db.glossdiv"/>
  418. </zeroOrMore>
  419. <zeroOrMore>
  420. <ref name="db.glossentry"/>
  421. </zeroOrMore>
  422. </choice>
  423. <optional>
  424. <ref name="db.bibliography"/>
  425. </optional>
  426. </element>
  427. </define>
  428. </div>
  429. <!-- ====================================================================== -->
  430. <div>
  431. <db:refname>glossdiv</db:refname>
  432. <db:refpurpose>A division in a glossary</db:refpurpose>
  433. <define name="db.glossdiv.status.attribute">
  434. <ref name="db.status.attribute"/>
  435. </define>
  436. <define name="db.glossdiv.role.attribute">
  437. <attribute name="role"/>
  438. </define>
  439. <define name="db.glossdiv.attlist">
  440. <interleave>
  441. <optional>
  442. <ref name="db.glossdiv.role.attribute"/>
  443. </optional>
  444. <ref name="db.common.attributes"/>
  445. <ref name="db.common.linking.attributes"/>
  446. <optional>
  447. <ref name="db.label.attribute"/>
  448. </optional>
  449. <optional>
  450. <ref name="db.glossdiv.status.attribute"/>
  451. </optional>
  452. </interleave>
  453. </define>
  454. <define name="db.glossdiv.info">
  455. <ref name="db._info.title.req"/>
  456. </define>
  457. <define name="db.glossdiv">
  458. <element name="glossdiv">
  459. <ref name="db.glossdiv.attlist"/>
  460. <ref name="db.glossdiv.info"/>
  461. <zeroOrMore>
  462. <ref name="db.all.blocks"/>
  463. </zeroOrMore>
  464. <oneOrMore>
  465. <ref name="db.glossentry"/>
  466. </oneOrMore>
  467. </element>
  468. </define>
  469. </div>
  470. <!-- ====================================================================== -->
  471. <define name="db.technical.inlines" combine="choice">
  472. <ref name="db.termdef"/>
  473. </define>
  474. <div>
  475. <db:refname>termdef</db:refname>
  476. <db:refpurpose>An inline definition of a term</db:refpurpose>
  477. <define name="db.termdef.role.attribute">
  478. <attribute name="role"/>
  479. </define>
  480. <define name="db.termdef.attlist">
  481. <interleave>
  482. <optional>
  483. <ref name="db.termdef.role.attribute"/>
  484. </optional>
  485. <optional>
  486. <ref name="db.glossentry.sortas.attribute"/>
  487. </optional>
  488. <ref name="db.common.attributes"/>
  489. <ref name="db.common.linking.attributes"/>
  490. <ref name="db.baseform.attribute"/>
  491. </interleave>
  492. </define>
  493. <define name="db.termdef">
  494. <element name="termdef">
  495. <s:pattern name="Glossary term definition constraint">
  496. <s:rule context="db:termdef">
  497. <s:assert test="count(db:firstterm) = 1">A termdef must contain exactly one firstterm</s:assert>
  498. </s:rule>
  499. </s:pattern>
  500. <ref name="db.termdef.attlist"/>
  501. <zeroOrMore>
  502. <ref name="db.all.inlines"/>
  503. </zeroOrMore>
  504. </element>
  505. </define>
  506. </div>
  507. </grammar>