@teipublisher/oddity-language-server 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +48 -2
  3. package/dist/edit.js +313 -0
  4. package/dist/edit.js.map +7 -0
  5. package/dist/index.js +803 -0
  6. package/dist/index.js.map +7 -0
  7. package/dist/node.cjs +44962 -0
  8. package/dist/node.cjs.map +7 -0
  9. package/package.json +74 -4
  10. package/schema/README.md +41 -0
  11. package/schema/docbook/docbook.rng +18457 -0
  12. package/schema/jats/BITS-embedded-index2.ent.rng +340 -0
  13. package/schema/jats/BITS-question-answer2.ent.rng +795 -0
  14. package/schema/jats/JATS-XHTMLtablesetup1-3.ent.rng +614 -0
  15. package/schema/jats/JATS-ali-namespace1-3.ent.rng +284 -0
  16. package/schema/jats/JATS-archivearticle1-3-mathml3.rng +1277 -0
  17. package/schema/jats/JATS-archivecustom-classes1-3.ent.rng +427 -0
  18. package/schema/jats/JATS-archivecustom-mixes1-3.ent.rng +630 -0
  19. package/schema/jats/JATS-archivecustom-models1-3.ent.rng +2205 -0
  20. package/schema/jats/JATS-articlemeta1-3.ent.rng +3138 -0
  21. package/schema/jats/JATS-backmatter1-3.ent.rng +601 -0
  22. package/schema/jats/JATS-chars1-3.ent.rng +715 -0
  23. package/schema/jats/JATS-common-atts1-3.ent.rng +367 -0
  24. package/schema/jats/JATS-common1-3.ent.rng +6007 -0
  25. package/schema/jats/JATS-default-classes1-3.ent.rng +1953 -0
  26. package/schema/jats/JATS-default-mixes1-3.ent.rng +583 -0
  27. package/schema/jats/JATS-display1-3.ent.rng +1669 -0
  28. package/schema/jats/JATS-format1-3.ent.rng +1256 -0
  29. package/schema/jats/JATS-funding1-3.ent.rng +1389 -0
  30. package/schema/jats/JATS-journalmeta1-3.ent.rng +691 -0
  31. package/schema/jats/JATS-link1-3.ent.rng +664 -0
  32. package/schema/jats/JATS-list1-3.ent.rng +747 -0
  33. package/schema/jats/JATS-math1-3.ent.rng +620 -0
  34. package/schema/jats/JATS-mathml3-mathmlsetup1-3.ent.rng +459 -0
  35. package/schema/jats/JATS-nlmcitation1-3.ent.rng +522 -0
  36. package/schema/jats/JATS-para1-3.ent.rng +780 -0
  37. package/schema/jats/JATS-phrase1-3.ent.rng +725 -0
  38. package/schema/jats/JATS-references1-3.ent.rng +1713 -0
  39. package/schema/jats/JATS-related-object1-3.ent.rng +453 -0
  40. package/schema/jats/JATS-section1-3.ent.rng +482 -0
  41. package/schema/jats/mathml3-qname1.mod.rng +61 -0
  42. package/schema/jats/mathml3.rng +4094 -0
  43. package/schema/jats/xhtml-inlstyle-1.mod.rng +37 -0
  44. package/schema/jats/xhtml-table-1.mod.rng +426 -0
  45. package/schema/odd/teipublisher_odds.rng +12769 -0
  46. package/schema/tei/tei_all.rng +23212 -0
  47. package/src/core/association.ts +155 -0
  48. package/src/core/complete.ts +147 -0
  49. package/src/core/elements.ts +86 -0
  50. package/src/core/outline.ts +156 -0
  51. package/src/core/schema.ts +55 -0
  52. package/src/core/tags.ts +104 -0
  53. package/src/core/toml.ts +64 -0
  54. package/src/core/validate.ts +128 -0
  55. package/src/core/wellformed.ts +16 -0
  56. package/src/edit.ts +11 -0
  57. package/src/index.ts +16 -0
  58. package/src/node.ts +39 -0
  59. package/src/server/server.ts +248 -0
@@ -0,0 +1,795 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!-- ============================================================= -->
3
+ <!-- MODULE: BITS Question and Answer Module -->
4
+ <!-- DATE: June 2015 -->
5
+ <!---->
6
+ <!-- ============================================================= -->
7
+ <!-- ============================================================= -->
8
+ <!-- PUBLIC DOCUMENT TYPE DEFINITION -->
9
+ <!-- TYPICAL INVOCATION -->
10
+ <!--
11
+ "-//NLM//DTD BITS Question and Answer Module v2.0 20151225//EN"
12
+ Delivered as file "BITS-question-answer2.ent"
13
+ -->
14
+ <!-- ============================================================= -->
15
+ <!-- ============================================================= -->
16
+ <!-- SYSTEM: Book Interchange Tag Suite -->
17
+ <!---->
18
+ <!-- PURPOSE: Defines a model for questions, sets of questions, -->
19
+ <!-- and answers. This is a very basic model, expected -->
20
+ <!-- to be extended. NOTE: This is NOT a model for a -->
21
+ <!-- quiz, test, or exam; such a containing model -->
22
+ <!-- could be built using sections and the questions -->
23
+ <!-- answers defined in this module. -->
24
+ <!---->
25
+ <!-- TAG SET SPONSOR -->
26
+ <!-- National Center for Biotechnology -->
27
+ <!-- Information (NCBI) -->
28
+ <!-- National Library of Medicine (NLM) -->
29
+ <!---->
30
+ <!-- CREATED FOR: -->
31
+ <!-- This DTD was created as a superset customization -->
32
+ <!-- of the ANSI/NISO JATS Z39.96-2012 Version 1.0 -->
33
+ <!-- Journal Article Tag Set. -->
34
+ <!---->
35
+ <!-- Digital archives and publishers may use the -->
36
+ <!-- DTD as is for markup of books or book-like -->
37
+ <!-- material for archiving and transferring -->
38
+ <!-- such material between archives or they may create -->
39
+ <!-- a custom XML DTD from the BITS Suite for -->
40
+ <!-- these purposes. -->
41
+ <!---->
42
+ <!-- This DTD is in the public domain. An organization -->
43
+ <!-- that wishes to create its own DTD from the suite -->
44
+ <!-- may do so without permission from NLM. -->
45
+ <!---->
46
+ <!-- The suite has been set up to be extended using a -->
47
+ <!-- new DTD file and new DTD-specific customization -->
48
+ <!-- modules to redefine the many Parameter Entities. -->
49
+ <!-- Do not modify the suite directly or redistribute -->
50
+ <!-- modified versions of the suite. -->
51
+ <!---->
52
+ <!-- In the interest of maintaining consistency and -->
53
+ <!-- clarity for potential users, NLM requests: -->
54
+ <!---->
55
+ <!-- 1. If you create a DTD from the BITS DTD Suite -->
56
+ <!-- and intend to stay compatible with the suite, -->
57
+ <!-- then please include the following statement -->
58
+ <!-- as a comment in all of your DTD modules: -->
59
+ <!-- "Created from, and fully compatible with, -->
60
+ <!-- the Book Interchange Tag Suite (BITS). -->
61
+ <!---->
62
+ <!-- 2. If you alter one or more modules of the suite, -->
63
+ <!-- then please rename your version and all its -->
64
+ <!-- modules to avoid any confusion with the -->
65
+ <!-- original suite. Also, please include the -->
66
+ <!-- following statement as a comment in all your -->
67
+ <!-- DTD modules: -->
68
+ <!-- "Based in part on, but not fully compatible -->
69
+ <!-- with, the Book Interchange Tag Suite -->
70
+ <!-- (BITS)." -->
71
+ <!---->
72
+ <!-- ORIGINAL CREATION DATE: -->
73
+ <!-- May 2013 -->
74
+ <!---->
75
+ <!-- CREATED BY: Mulberry Technologies, Inc. for the National -->
76
+ <!-- National Center for Biotechnology Information -->
77
+ <!-- (NCBI), a center of the US National Library of -->
78
+ <!-- Medicine (NLM). -->
79
+ <!---->
80
+ <!-- The BITS Book Interchange DTD is built from the -->
81
+ <!-- Journal Archiving and Interchange DTD of the -->
82
+ <!-- ANSI/NISO Journal Article Tag Suite (JATS) -->
83
+ <!-- Version 1.1d1 (Z39.96-2015). -->
84
+ <!---->
85
+ <!-- Suggestions for refinements and enhancements to -->
86
+ <!-- this DTD should be sent in email to: -->
87
+ <!-- bits@ncbi.nlm.nih.gov -->
88
+ <!-- ============================================================= -->
89
+ <!-- ============================================================= -->
90
+ <!-- DTD VERSION/CHANGE HISTORY -->
91
+ <!-- ============================================================= -->
92
+ <!--
93
+ Version Reason/Occasion (who) vx.x (yyyy-mm-dd)
94
+ =============================================================
95
+ BITS Version 2.0 (DAL/BTU) v2.0 (2015-12-25)
96
+ JATS Version 1.1 (DAL/BTU) v1.1 (2015-12-15)
97
+
98
+ JATS is a continuing maintenance NISO Standard, which
99
+ requires voting by the ANSI and NISO memberships to be changed.
100
+ JATS 1.1 was approved in late 2015, and BITS modified to use
101
+ the most recent version. No other changes to BITS were made.
102
+
103
+ 12. BITS remained version "2.0" but becomes "v2.0 20151225"
104
+ JATS became version "1.1" and "v1.1 20151215"
105
+
106
+ =============================================================
107
+ BITS Version 2.0 (DAL/BTU) v2.0 (2015-03-15)
108
+ JATS Version 1.1 (DAL/BTU) v1.1 (2015-03-01)
109
+
110
+ BITS was modified, based on user feedback collected in 2014
111
+ and January/February 2015, according to the decisions
112
+ made by the BITS Working Group. This DTD represents current
113
+ BITS and an interim version of the non-normative JATS DTD
114
+ Suite (version 1.1), as an indication to JATS users of
115
+ the decisions that have been made by the JATS Standing
116
+ Committee.
117
+
118
+ NISO JATS is a continuing maintenance NISO Standard, which
119
+ requires voting by the NISO membership to be changed. This
120
+ Committee Draft 1.1 will be sent to the NISO voting
121
+ membership, to become (if approved) NISO JATS 1.1.
122
+
123
+ 11. TITLE/SUBTITLE/ALT-TIT/E ETC. - Some of the question/answer
124
+ components could take subtitles and alt-titles as well as titles,
125
+ but all could not. Regularized them to include all title
126
+ types if a title was possible.
127
+
128
+ 10. EXPLANATION - was given a new section-level model similar
129
+ to that for <answer>.
130
+
131
+ 9. ANSWER-SPECIFIC PARAGRAPH-LEVEL OBJECTS
132
+ Created a new PE (answer-para-level) to prohibit
133
+ <explanation> at the paragraph level inside
134
+ <answer>, because that created DTD determinism problems.
135
+ Rewrote <answer> model to use this PE.
136
+
137
+ 8. QUESTION MODEL - changed the model for <question> to:
138
+ - call all the components of sec-opt-title-model
139
+ rather than calling the grouping PE
140
+ - Add new element <option>, which is used for multiple
141
+ choice questions (instead of <answer>)
142
+
143
+ 7. ANSWER/QUESTION ATTRIBUTES
144
+ - Removed @correct (yes | no) from <answer> and from
145
+ <answer-set>, because, by definition, an <answer>
146
+ is correct. The <option> element may now be marked
147
+ with a @correct attribute ('yes' or 'no').
148
+ -Removed @answer-type from <answer>, since this is
149
+ really about the question, not the answer.
150
+ - Added new attribute @question-response-type to
151
+ <question>, which takes the old values for @answer-type
152
+ (multiple choice, short answer, essay, etc.)
153
+
154
+ 6. XML:LANG ATTRIBUTE - Added @xml:lang to the attributes lists
155
+ of <question-wrap> and <question-wrap-group>.
156
+
157
+ 5. EXPLANATION - Added @rid to <explanation> since these can
158
+ now float in the text as answers can.
159
+
160
+ 4. QUESTION-PREAMBLE - Added new element to hold setup/
161
+ preamble information, when the setup is shared by several
162
+ questions, for example, a diagram is shown and the questions
163
+ are similar to "What is angle a?". This preamble is part of
164
+ a <question-wrap-group> that contains the preamble/setup
165
+ (<question-preamble>) and several questions
166
+ (<question-wrap>).
167
+
168
+ 3. QUESTION-WRAP-GROUP - Added new element <question-wrap-group>
169
+ to hold a question setup/preamble (<question-preamble>)
170
+ and two or more <question-wrap>s based on that preamble.
171
+
172
+ 2. BITS became version "2.0" and "v2.0 20150630"
173
+ JATS became version "1.1" and "v1.1 20150301"
174
+
175
+ =============================================================
176
+ BITS Version 1.1 (DAL/BTU) v1.1 (2014-09-30)
177
+ JATS Version 1.1d2 (DAL/BTU) v1.1d2 (2014-09-30)
178
+
179
+ NISO JATS is a continuing maintenance NISO Standard, which
180
+ requires voting by the NISO membership to be changed. This
181
+ Committee Draft 1.1d2 will be sent to the NISO voting
182
+ membership, to become (if approved) NISO JATS 1.1.
183
+
184
+ This catalog represents an interim version of the
185
+ non-normative JATS DTD Suite, as an indication to JATS users
186
+ the decisions that have been made by the JATS Standing
187
+ Committee.
188
+
189
+ 1. BITS became version "1.1" and "v1.1 20140930//EN"
190
+ JATS became version "1.1d2" and "v1.1d2 20140930//EN"
191
+
192
+ =============================================================
193
+ -->
194
+ <!-- ============================================================= -->
195
+ <!-- PARAMETER ENTITIES FOR ATTRIBUTE VALUES -->
196
+ <!-- ============================================================= -->
197
+ <!-- TYPES OF ANSWERS -->
198
+ <!--
199
+ Used to name the type of question or
200
+ question set.
201
+ -->
202
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
203
+ <define name="answer-types">
204
+ <choice>
205
+ <value>essay</value>
206
+ <value>fill-in-the-blank</value>
207
+ <value>multi-select</value>
208
+ <value>multiple-choice</value>
209
+ <value>short-answer</value>
210
+ <value>true-false</value>
211
+ </choice>
212
+ </define>
213
+ <!-- ============================================================= -->
214
+ <!-- PARAMETER ENTITIES FOR ATTRIBUTE LISTS -->
215
+ <!-- ============================================================= -->
216
+ <!-- QUESTION ATTRIBUTES -->
217
+ <!-- Attributes for the <question> element -->
218
+ <define name="question-atts">
219
+ <ref name="jats-common-atts"/>
220
+ <optional>
221
+ <attribute name="question-response-type">
222
+ <choice>
223
+ <ref name="answer-types"/>
224
+ </choice>
225
+ </attribute>
226
+ </optional>
227
+ <optional>
228
+ <attribute name="content-type"/>
229
+ </optional>
230
+ <optional>
231
+ <attribute name="specific-use"/>
232
+ </optional>
233
+ <optional>
234
+ <attribute name="xml:lang">
235
+ <data type="NMTOKEN"/>
236
+ </attribute>
237
+ </optional>
238
+ </define>
239
+ <!-- QUESTION PREAMBLE ATTRIBUTES -->
240
+ <!--
241
+ Attributes for the <question-preamble>
242
+ element
243
+ -->
244
+ <define name="question-preamble-atts">
245
+ <ref name="jats-common-atts"/>
246
+ <optional>
247
+ <attribute name="content-type"/>
248
+ </optional>
249
+ <optional>
250
+ <attribute name="specific-use"/>
251
+ </optional>
252
+ <optional>
253
+ <attribute name="xml:lang">
254
+ <data type="NMTOKEN"/>
255
+ </attribute>
256
+ </optional>
257
+ </define>
258
+ <!-- QUESTION WRAP ATTRIBUTES -->
259
+ <!-- Attributes for the <question-wrap> element -->
260
+ <define name="question-wrap-atts">
261
+ <ref name="jats-common-atts"/>
262
+ <optional>
263
+ <attribute name="audience"/>
264
+ </optional>
265
+ <optional>
266
+ <attribute name="content-type"/>
267
+ </optional>
268
+ <optional>
269
+ <attribute name="specific-use"/>
270
+ </optional>
271
+ <optional>
272
+ <attribute name="xml:lang">
273
+ <data type="NMTOKEN"/>
274
+ </attribute>
275
+ </optional>
276
+ </define>
277
+ <!-- QUESTION WRAP GROUP ATTRIBUTES -->
278
+ <!--
279
+ Attributes for the <question-wrap-group>
280
+ element
281
+ -->
282
+ <define name="question-wrap-group-atts">
283
+ <ref name="jats-common-atts"/>
284
+ <optional>
285
+ <attribute name="audience"/>
286
+ </optional>
287
+ <optional>
288
+ <attribute name="content-type"/>
289
+ </optional>
290
+ <optional>
291
+ <attribute name="specific-use"/>
292
+ </optional>
293
+ <optional>
294
+ <attribute name="xml:lang">
295
+ <data type="NMTOKEN"/>
296
+ </attribute>
297
+ </optional>
298
+ </define>
299
+ <!-- ANSWER ATTRIBUTES -->
300
+ <!-- Attributes for the <answer> element -->
301
+ <define name="answer-atts">
302
+ <ref name="jats-common-atts"/>
303
+ <attribute name="pointer-to-question">
304
+ <data type="IDREFS"/>
305
+ </attribute>
306
+ <optional>
307
+ <attribute name="content-type"/>
308
+ </optional>
309
+ <optional>
310
+ <attribute name="specific-use"/>
311
+ </optional>
312
+ <optional>
313
+ <attribute name="xml:lang">
314
+ <data type="NMTOKEN"/>
315
+ </attribute>
316
+ </optional>
317
+ </define>
318
+ <!-- ANSWER SET ATTRIBUTES -->
319
+ <!-- Attributes for the <answer-set> element -->
320
+ <define name="answer-set-atts">
321
+ <ref name="jats-common-atts"/>
322
+ <optional>
323
+ <attribute name="content-type"/>
324
+ </optional>
325
+ <optional>
326
+ <attribute name="specific-use"/>
327
+ </optional>
328
+ <optional>
329
+ <attribute name="xml:lang">
330
+ <data type="NMTOKEN"/>
331
+ </attribute>
332
+ </optional>
333
+ </define>
334
+ <!-- EXPLANATION ATTRIBUTES -->
335
+ <!-- Attributes for the <explanation> element -->
336
+ <define name="explanation-atts">
337
+ <ref name="jats-common-atts"/>
338
+ <attribute name="pointer-to-explained">
339
+ <data type="IDREFS"/>
340
+ </attribute>
341
+ <optional>
342
+ <attribute name="content-type"/>
343
+ </optional>
344
+ <optional>
345
+ <attribute name="specific-use"/>
346
+ </optional>
347
+ <optional>
348
+ <attribute name="xml:lang">
349
+ <data type="NMTOKEN"/>
350
+ </attribute>
351
+ </optional>
352
+ </define>
353
+ <!-- OPTION ATTRIBUTES -->
354
+ <!-- Attributes for the <option> element -->
355
+ <define name="option-atts">
356
+ <ref name="jats-common-atts"/>
357
+ <optional>
358
+ <attribute name="correct">
359
+ <choice>
360
+ <value>yes</value>
361
+ <value>no</value>
362
+ </choice>
363
+ </attribute>
364
+ </optional>
365
+ <optional>
366
+ <attribute name="content-type"/>
367
+ </optional>
368
+ <optional>
369
+ <attribute name="specific-use"/>
370
+ </optional>
371
+ <optional>
372
+ <attribute name="xml:lang">
373
+ <data type="NMTOKEN"/>
374
+ </attribute>
375
+ </optional>
376
+ </define>
377
+ <!-- ============================================================= -->
378
+ <!-- QUESTION ELEMENTS -->
379
+ <!-- ============================================================= -->
380
+ <!-- QUESTION MODEL -->
381
+ <!-- Content model for the <question> element. -->
382
+ <define name="question-model">
383
+ <zeroOrMore>
384
+ <ref name="id.class"/>
385
+ </zeroOrMore>
386
+ <optional>
387
+ <ref name="sec-meta"/>
388
+ </optional>
389
+ <optional>
390
+ <ref name="label"/>
391
+ </optional>
392
+ <optional>
393
+ <ref name="title"/>
394
+ </optional>
395
+ <zeroOrMore>
396
+ <ref name="subtitle"/>
397
+ </zeroOrMore>
398
+ <zeroOrMore>
399
+ <ref name="alt-title"/>
400
+ </zeroOrMore>
401
+ <choice>
402
+ <oneOrMore>
403
+ <ref name="sec-level"/>
404
+ </oneOrMore>
405
+ <group>
406
+ <oneOrMore>
407
+ <ref name="para-level"/>
408
+ </oneOrMore>
409
+ <zeroOrMore>
410
+ <ref name="sec-level"/>
411
+ </zeroOrMore>
412
+ </group>
413
+ </choice>
414
+ <zeroOrMore>
415
+ <ref name="option.class"/>
416
+ </zeroOrMore>
417
+ <zeroOrMore>
418
+ <ref name="sec-back-matter-mix"/>
419
+ </zeroOrMore>
420
+ </define>
421
+ <!-- QUESTION -->
422
+ <!--
423
+ A question (request for an answer) used in
424
+ the text or as part of a quiz, exam, etc.
425
+ Details at:
426
+ http://jats.nlm.nih.gov/extensions/bits/2.0/index.html?elem=question
427
+ -->
428
+ <define name="question">
429
+ <element name="question">
430
+ <ref name="question-attlist"/>
431
+ <ref name="question-model"/>
432
+ </element>
433
+ </define>
434
+ <define name="question-attlist" combine="interleave">
435
+ <ref name="question-atts"/>
436
+ </define>
437
+ <!-- QUESTION WRAP MODEL -->
438
+ <!--
439
+ Content model for the <question-wrap>
440
+ element.
441
+ -->
442
+ <define name="question-wrap-model">
443
+ <zeroOrMore>
444
+ <ref name="id.class"/>
445
+ </zeroOrMore>
446
+ <ref name="question"/>
447
+ <optional>
448
+ <choice>
449
+ <ref name="answer"/>
450
+ <ref name="answer-set"/>
451
+ </choice>
452
+ </optional>
453
+ <zeroOrMore>
454
+ <ref name="explanation"/>
455
+ </zeroOrMore>
456
+ </define>
457
+ <!-- QUESTION WRAP -->
458
+ <!--
459
+ Used to model a Question/Answer scheme. These
460
+ questions may be used, for example, for the
461
+ Continuing Medical Education articles in a
462
+ book of articles. The model allows for
463
+ simple questions followed by their
464
+ corresponding answers or for a multiple
465
+ choice setup, where questions are followed
466
+ by multiple alternative answers (<option>s),
467
+ along with the correct answer and an
468
+ explanation.
469
+ Note: This is not the model for a full
470
+ quiz, test, exam, etc., but such a model
471
+ could be built using these components for
472
+ the question/answers.
473
+ Details at:
474
+ http://jats.nlm.nih.gov/extensions/bits/2.0/index.html?elem=question-wrap
475
+ -->
476
+ <define name="question-wrap">
477
+ <element name="question-wrap">
478
+ <ref name="question-wrap-attlist"/>
479
+ <ref name="question-wrap-model"/>
480
+ </element>
481
+ </define>
482
+ <define name="question-wrap-attlist" combine="interleave">
483
+ <ref name="question-wrap-atts"/>
484
+ </define>
485
+ <!-- QUESTION WRAP GROUP MODEL -->
486
+ <!--
487
+ Content model for the <question-wrap-group>
488
+ element.
489
+ -->
490
+ <define name="question-wrap-group-model">
491
+ <zeroOrMore>
492
+ <ref name="id.class"/>
493
+ </zeroOrMore>
494
+ <optional>
495
+ <ref name="label"/>
496
+ </optional>
497
+ <optional>
498
+ <ref name="title"/>
499
+ </optional>
500
+ <zeroOrMore>
501
+ <ref name="subtitle"/>
502
+ </zeroOrMore>
503
+ <zeroOrMore>
504
+ <ref name="alt-title"/>
505
+ </zeroOrMore>
506
+ <optional>
507
+ <ref name="question-preamble"/>
508
+ </optional>
509
+ <oneOrMore>
510
+ <ref name="question-wrap.class"/>
511
+ </oneOrMore>
512
+ </define>
513
+ <!-- QUESTION WRAP GROUP -->
514
+ <!--
515
+ A container element used to hold a group of
516
+ <question-wrap> elements, for example, when
517
+ all the questions share a common preamble
518
+ (setup).
519
+ Note: This is not the model for a full
520
+ quiz, test, exam, etc., but such a model
521
+ could be built using these components for
522
+ the question/answers.
523
+ Details at:
524
+ http://jats.nlm.nih.gov/extensions/bits/2.0/index.html?elem=question-wrap-group
525
+ -->
526
+ <define name="question-wrap-group">
527
+ <element name="question-wrap-group">
528
+ <ref name="question-wrap-group-attlist"/>
529
+ <ref name="question-wrap-group-model"/>
530
+ </element>
531
+ </define>
532
+ <define name="question-wrap-group-attlist" combine="interleave">
533
+ <ref name="question-wrap-group-atts"/>
534
+ </define>
535
+ <!-- QUESTION PREAMBLE MODEL -->
536
+ <!--
537
+ Content model for the <question-preamble>
538
+ element.
539
+ -->
540
+ <define name="question-preamble-model">
541
+ <zeroOrMore>
542
+ <ref name="id.class"/>
543
+ </zeroOrMore>
544
+ <optional>
545
+ <ref name="label"/>
546
+ </optional>
547
+ <optional>
548
+ <ref name="title"/>
549
+ </optional>
550
+ <zeroOrMore>
551
+ <ref name="subtitle"/>
552
+ </zeroOrMore>
553
+ <zeroOrMore>
554
+ <ref name="alt-title"/>
555
+ </zeroOrMore>
556
+ <zeroOrMore>
557
+ <ref name="para-level"/>
558
+ </zeroOrMore>
559
+ <zeroOrMore>
560
+ <ref name="sec.class"/>
561
+ </zeroOrMore>
562
+ </define>
563
+ <!-- QUESTION PREAMBLE -->
564
+ <!--
565
+ A container element used setup/
566
+ preamble information when the setup is shared
567
+ by several questions, for example, a diagram
568
+ is shown and the questions are similar to
569
+ "What is angle a?".
570
+ Remarks: The preamble information is part of
571
+ a <question-wrap-group> that contains the
572
+ preamble/setup (<question-preamble>) and
573
+ several questions (tagged as <question-wrap>s).
574
+ Details at:
575
+ http://jats.nlm.nih.gov/extensions/bits/2.0/index.html?elem=question-preamble
576
+ -->
577
+ <define name="question-preamble">
578
+ <element name="question-preamble">
579
+ <ref name="question-preamble-attlist"/>
580
+ <ref name="question-preamble-model"/>
581
+ </element>
582
+ </define>
583
+ <define name="question-preamble-attlist" combine="interleave">
584
+ <ref name="question-preamble-atts"/>
585
+ </define>
586
+ <!-- ============================================================= -->
587
+ <!-- ANSWER/EXPLANATION ELEMENTS -->
588
+ <!-- ============================================================= -->
589
+ <!-- ANSWER MODEL -->
590
+ <!-- Content model for the <answer> element. -->
591
+ <define name="answer-model">
592
+ <zeroOrMore>
593
+ <ref name="id.class"/>
594
+ </zeroOrMore>
595
+ <optional>
596
+ <ref name="label"/>
597
+ </optional>
598
+ <optional>
599
+ <ref name="title"/>
600
+ </optional>
601
+ <zeroOrMore>
602
+ <ref name="subtitle"/>
603
+ </zeroOrMore>
604
+ <zeroOrMore>
605
+ <ref name="alt-title"/>
606
+ </zeroOrMore>
607
+ <choice>
608
+ <oneOrMore>
609
+ <ref name="sec-level"/>
610
+ </oneOrMore>
611
+ <group>
612
+ <oneOrMore>
613
+ <ref name="answer-para-level"/>
614
+ </oneOrMore>
615
+ <zeroOrMore>
616
+ <ref name="sec-level"/>
617
+ </zeroOrMore>
618
+ </group>
619
+ </choice>
620
+ <zeroOrMore>
621
+ <ref name="sec-back-matter-mix"/>
622
+ </zeroOrMore>
623
+ <zeroOrMore>
624
+ <ref name="explanation"/>
625
+ </zeroOrMore>
626
+ </define>
627
+ <!-- ANSWER ELEMENTS -->
628
+ <!--
629
+ An answer to a question
630
+ Details at:
631
+ http://jats.nlm.nih.gov/extensions/bits/2.0/index.html?elem=answer
632
+ -->
633
+ <define name="answer">
634
+ <element name="answer">
635
+ <ref name="answer-attlist"/>
636
+ <ref name="answer-model"/>
637
+ </element>
638
+ </define>
639
+ <define name="answer-attlist" combine="interleave">
640
+ <ref name="answer-atts"/>
641
+ </define>
642
+ <!-- ANSWER SET MODEL -->
643
+ <!-- Content model for the <answer-set> element. -->
644
+ <define name="answer-set-model">
645
+ <zeroOrMore>
646
+ <ref name="id.class"/>
647
+ </zeroOrMore>
648
+ <optional>
649
+ <ref name="label"/>
650
+ </optional>
651
+ <optional>
652
+ <ref name="title"/>
653
+ </optional>
654
+ <zeroOrMore>
655
+ <ref name="subtitle"/>
656
+ </zeroOrMore>
657
+ <zeroOrMore>
658
+ <ref name="alt-title"/>
659
+ </zeroOrMore>
660
+ <oneOrMore>
661
+ <choice>
662
+ <ref name="answer"/>
663
+ <ref name="just-para.class"/>
664
+ <ref name="explanation"/>
665
+ </choice>
666
+ </oneOrMore>
667
+ </define>
668
+ <!-- ANSWER SET -->
669
+ <!--
670
+ A series of answers, typically in response
671
+ to a question.
672
+ Details at:
673
+ http://jats.nlm.nih.gov/extensions/bits/2.0/index.html?elem=answer-set
674
+ -->
675
+ <define name="answer-set">
676
+ <element name="answer-set">
677
+ <ref name="answer-set-attlist"/>
678
+ <ref name="answer-set-model"/>
679
+ </element>
680
+ </define>
681
+ <define name="answer-set-attlist" combine="interleave">
682
+ <ref name="answer-set-atts"/>
683
+ </define>
684
+ <!-- EXPLANATION MODEL -->
685
+ <!-- Content model for the <answer-set> element. -->
686
+ <define name="explanation-model">
687
+ <zeroOrMore>
688
+ <ref name="id.class"/>
689
+ </zeroOrMore>
690
+ <optional>
691
+ <ref name="label"/>
692
+ </optional>
693
+ <optional>
694
+ <ref name="title"/>
695
+ </optional>
696
+ <zeroOrMore>
697
+ <ref name="subtitle"/>
698
+ </zeroOrMore>
699
+ <zeroOrMore>
700
+ <ref name="alt-title"/>
701
+ </zeroOrMore>
702
+ <choice>
703
+ <oneOrMore>
704
+ <ref name="sec-level"/>
705
+ </oneOrMore>
706
+ <group>
707
+ <oneOrMore>
708
+ <ref name="answer-para-level"/>
709
+ </oneOrMore>
710
+ <zeroOrMore>
711
+ <ref name="sec-level"/>
712
+ </zeroOrMore>
713
+ </group>
714
+ </choice>
715
+ <zeroOrMore>
716
+ <ref name="sec-back-matter-mix"/>
717
+ </zeroOrMore>
718
+ </define>
719
+ <!-- EXPLANATION -->
720
+ <!--
721
+ A description of a question/answer or of just
722
+ an answer or answer set. The explanation
723
+ may describe, for example, why this
724
+ particular answer is incorrect, or where in
725
+ the text the material for this question
726
+ can be found, et al.
727
+ Details at:
728
+ http://jats.nlm.nih.gov/extensions/bits/2.0/index.html?elem=explanation
729
+ -->
730
+ <define name="explanation">
731
+ <element name="explanation">
732
+ <ref name="explanation-attlist"/>
733
+ <ref name="explanation-model"/>
734
+ </element>
735
+ </define>
736
+ <define name="explanation-attlist" combine="interleave">
737
+ <ref name="explanation-atts"/>
738
+ </define>
739
+ <!-- OPTION MODEL -->
740
+ <!-- Content model for the <option> element. -->
741
+ <define name="option-model">
742
+ <zeroOrMore>
743
+ <ref name="id.class"/>
744
+ </zeroOrMore>
745
+ <optional>
746
+ <ref name="label"/>
747
+ </optional>
748
+ <optional>
749
+ <ref name="title"/>
750
+ </optional>
751
+ <zeroOrMore>
752
+ <ref name="subtitle"/>
753
+ </zeroOrMore>
754
+ <zeroOrMore>
755
+ <ref name="alt-title"/>
756
+ </zeroOrMore>
757
+ <choice>
758
+ <oneOrMore>
759
+ <ref name="sec-level"/>
760
+ </oneOrMore>
761
+ <group>
762
+ <oneOrMore>
763
+ <ref name="answer-para-level"/>
764
+ </oneOrMore>
765
+ <zeroOrMore>
766
+ <ref name="sec-level"/>
767
+ </zeroOrMore>
768
+ </group>
769
+ </choice>
770
+ <zeroOrMore>
771
+ <ref name="sec-back-matter-mix"/>
772
+ </zeroOrMore>
773
+ <zeroOrMore>
774
+ <ref name="explanation"/>
775
+ </zeroOrMore>
776
+ </define>
777
+ <!-- OPTION ELEMENTS -->
778
+ <!--
779
+ One of the possible answer-choices for a
780
+ multiple-choice question. An attribute can be
781
+ used to identify options which are correct.
782
+ Details at:
783
+ http://jats.nlm.nih.gov/extensions/bits/2.0/index.html?elem=option
784
+ -->
785
+ <define name="option">
786
+ <element name="option">
787
+ <ref name="option-attlist"/>
788
+ <ref name="option-model"/>
789
+ </element>
790
+ </define>
791
+ <define name="option-attlist" combine="interleave">
792
+ <ref name="option-atts"/>
793
+ </define>
794
+ </grammar>
795
+ <!-- ================== End BITS Question and Answer Module ====== -->