patrick@73
|
1 |
# $Id$
|
patrick@73
|
2 |
|
patrick@73
|
3 |
|
patrick@73
|
4 |
include "publidoc.rnc" {
|
patrick@73
|
5 |
start = publiquiz
|
patrick@73
|
6 |
|
patrick@73
|
7 |
document.content =
|
patrick@73
|
8 |
top.head?,
|
patrick@73
|
9 |
(division | topic | quiz)+
|
patrick@84
|
10 |
|
patrick@84
|
11 |
division.content =
|
patrick@84
|
12 |
division.head?,
|
patrick@84
|
13 |
(division | topic | quiz)+
|
patrick@73
|
14 |
}
|
patrick@73
|
15 |
|
patrick@75
|
16 |
|
patrick@73
|
17 |
publiquiz = element publiquiz {
|
patrick@73
|
18 |
publiquiz.attributes,
|
patrick@73
|
19 |
publiquiz.content
|
patrick@73
|
20 |
}
|
patrick@73
|
21 |
|
patrick@73
|
22 |
publiquiz.attributes =
|
patrick@73
|
23 |
version.attribute
|
patrick@73
|
24 |
|
patrick@73
|
25 |
publiquiz.content =
|
patrick@73
|
26 |
document
|
patrick@73
|
27 |
| top.quiz
|
patrick@73
|
28 |
|
patrick@73
|
29 |
|
patrick@73
|
30 |
# =============================================================================
|
patrick@73
|
31 |
# TOP LEVEL
|
patrick@73
|
32 |
# =============================================================================
|
patrick@73
|
33 |
|
Patrick@310
|
34 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
35 |
|
patrick@128
|
36 |
top.quiz = element quiz { top.quiz.attributes, top.quiz.content }
|
patrick@73
|
37 |
|
patrick@73
|
38 |
top.quiz.attributes =
|
patrick@73
|
39 |
quiz.id.attribute
|
Patrick@158
|
40 |
& quiz.type.attribute?
|
patrick@73
|
41 |
& lang.attribute?
|
patrick@117
|
42 |
quiz.id.attribute = attribute id { xsd:NMTOKEN }
|
Patrick@158
|
43 |
quiz.type.attribute = attribute type { xsd:NCName }
|
patrick@73
|
44 |
|
patrick@128
|
45 |
top.quiz.content =
|
patrick@128
|
46 |
top.head?,
|
patrick@128
|
47 |
instructions,
|
patrick@128
|
48 |
(engine | composite),
|
patrick@128
|
49 |
help?,
|
patrick@128
|
50 |
answer?
|
patrick@73
|
51 |
|
Patrick@310
|
52 |
|
patrick@73
|
53 |
# =============================================================================
|
Patrick@310
|
54 |
# COMPONENT LEVEL
|
patrick@73
|
55 |
# =============================================================================
|
patrick@73
|
56 |
|
patrick@73
|
57 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
58 |
|
patrick@73
|
59 |
quiz = element quiz { quiz.attributes, quiz.content }
|
patrick@73
|
60 |
|
patrick@73
|
61 |
quiz.attributes =
|
Patrick@310
|
62 |
(quiz.id.attribute | xmlid.attribute)?
|
Patrick@158
|
63 |
& quiz.type.attribute?
|
patrick@73
|
64 |
& lang.attribute?
|
patrick@73
|
65 |
|
patrick@73
|
66 |
quiz.content =
|
patrick@73
|
67 |
component.head?,
|
patrick@73
|
68 |
instructions,
|
patrick@87
|
69 |
(engine | composite),
|
patrick@73
|
70 |
help?,
|
patrick@87
|
71 |
answer?
|
patrick@73
|
72 |
|
patrick@73
|
73 |
|
patrick@73
|
74 |
# =============================================================================
|
patrick@73
|
75 |
# SECTION LEVEL
|
patrick@73
|
76 |
# =============================================================================
|
patrick@73
|
77 |
|
patrick@73
|
78 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
79 |
|
patrick@73
|
80 |
blanks.section = element section { section.attributes, blanks.section.content }
|
Patrick@336
|
81 |
pointing.section = element section {
|
Patrick@336
|
82 |
section.attributes, pointing.section.content }
|
patrick@73
|
83 |
|
patrick@73
|
84 |
blanks.section.content =
|
patrick@73
|
85 |
section.head?,
|
patrick@73
|
86 |
(blanks.section+ | blanks.block+)
|
Patrick@336
|
87 |
pointing.section.content =
|
patrick@73
|
88 |
section.head?,
|
Patrick@336
|
89 |
(pointing.section+ | pointing.block+)
|
patrick@73
|
90 |
|
patrick@73
|
91 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ instructions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
92 |
|
patrick@73
|
93 |
instructions = element instructions { section.content }
|
patrick@73
|
94 |
|
patrick@73
|
95 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
96 |
|
patrick@73
|
97 |
engine =
|
patrick@87
|
98 |
choices-radio
|
patrick@87
|
99 |
| choices-check
|
patrick@87
|
100 |
| blanks-fill
|
patrick@87
|
101 |
| blanks-select
|
Patrick@216
|
102 |
| blanks-char
|
Patrick@336
|
103 |
| pointing
|
Patrick@336
|
104 |
| pointing-categories
|
patrick@73
|
105 |
| matching
|
patrick@73
|
106 |
| sort
|
patrick@125
|
107 |
| categories
|
patrick@194
|
108 |
| pip
|
patrick@87
|
109 |
| production
|
patrick@73
|
110 |
|
patrick@73
|
111 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
112 |
|
patrick@87
|
113 |
choices-radio = element choices-radio {
|
patrick@87
|
114 |
choices.attributes, choices-radio.content }
|
patrick@87
|
115 |
choices-check = element choices-check {
|
patrick@87
|
116 |
choices.attributes, choices-check.content }
|
patrick@73
|
117 |
|
patrick@73
|
118 |
choices.attributes =
|
patrick@73
|
119 |
shuffle.attribute?
|
patrick@73
|
120 |
shuffle.attribute = attribute shuffle { xsd:boolean }
|
patrick@73
|
121 |
|
patrick@87
|
122 |
choices-radio.content =
|
patrick@73
|
123 |
choices.right
|
patrick@73
|
124 |
& choices.wrong+
|
patrick@87
|
125 |
choices-check.content =
|
patrick@73
|
126 |
(choices.right | choices.wrong)+
|
patrick@73
|
127 |
|
patrick@73
|
128 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
129 |
|
patrick@87
|
130 |
blanks-fill = element blanks-fill {
|
patrick@87
|
131 |
blanks-fill.attributes, blanks-fill.content }
|
patrick@87
|
132 |
blanks-select = element blanks-select {
|
patrick@87
|
133 |
blanks-select.attributes, blanks-select.content }
|
Patrick@216
|
134 |
blanks-char = element blanks-char { blanks-select.content }
|
patrick@73
|
135 |
|
patrick@87
|
136 |
blanks-fill.attributes =
|
patrick@75
|
137 |
strict.attribute?
|
patrick@87
|
138 |
blanks-select.attributes =
|
patrick@73
|
139 |
multiple.attribute?
|
patrick@73
|
140 |
strict.attribute = attribute strict { xsd:boolean }
|
patrick@73
|
141 |
multiple.attribute = attribute multiple { xsd:boolean }
|
patrick@73
|
142 |
|
patrick@87
|
143 |
blanks-fill.content =
|
patrick@73
|
144 |
(blanks.block+ | blanks.section+)
|
patrick@87
|
145 |
blanks-select.content =
|
patrick@73
|
146 |
blanks.wrongs?,
|
patrick@73
|
147 |
(blanks.block+ | blanks.section+)
|
patrick@73
|
148 |
|
Patrick@336
|
149 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
150 |
|
Patrick@336
|
151 |
pointing = element pointing { pointing.attributes, pointing.content }
|
patrick@75
|
152 |
|
Patrick@336
|
153 |
pointing.attributes =
|
Patrick@336
|
154 |
pointing.type.attribute?
|
Patrick@336
|
155 |
pointing.type.attribute = attribute type { "radio" | "check" }
|
patrick@73
|
156 |
|
Patrick@336
|
157 |
pointing.content =
|
Patrick@336
|
158 |
(pointing.section+ | pointing.block+)
|
Patrick@336
|
159 |
|
Patrick@336
|
160 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing-categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Patrick@336
|
161 |
|
Patrick@336
|
162 |
# ~~~~~~ pointing-categories
|
Patrick@336
|
163 |
pointing-categories = element pointing-categories { pointing-c.content }
|
Patrick@336
|
164 |
|
Patrick@336
|
165 |
pointing-c.content =
|
Patrick@336
|
166 |
pointing-c.categories,
|
Patrick@336
|
167 |
pointing.section
|
Patrick@336
|
168 |
|
Patrick@336
|
169 |
# ~~~~~~ pointing-c.categories
|
Patrick@336
|
170 |
pointing-c.categories = element categories { pointing-c.categories.content }
|
Patrick@336
|
171 |
|
Patrick@336
|
172 |
pointing-c.categories.content =
|
Patrick@336
|
173 |
pointing-c.category1,
|
Patrick@336
|
174 |
pointing-c.category2,
|
Patrick@336
|
175 |
(pointing-c.category3,
|
Patrick@336
|
176 |
(pointing-c.category4, pointing-c.category5?)?)?
|
Patrick@336
|
177 |
|
Patrick@336
|
178 |
# ~~~~~~ pointing-c.categoryN
|
Patrick@336
|
179 |
pointing-c.category1 = element category {
|
Patrick@336
|
180 |
attribute id { "1" }, pointing-c.category.content }
|
Patrick@336
|
181 |
pointing-c.category2 = element category {
|
Patrick@336
|
182 |
attribute id { "2" }, pointing-c.category.content }
|
Patrick@336
|
183 |
pointing-c.category3 = element category {
|
Patrick@336
|
184 |
attribute id { "3" }, pointing-c.category.content }
|
Patrick@336
|
185 |
pointing-c.category4 = element category {
|
Patrick@336
|
186 |
attribute id { "4" }, pointing-c.category.content }
|
Patrick@336
|
187 |
pointing-c.category5 = element category {
|
Patrick@336
|
188 |
attribute id { "5" }, pointing-c.category.content }
|
Patrick@336
|
189 |
|
Patrick@336
|
190 |
pointing-c.category.content = inlines
|
Patrick@336
|
191 |
|
patrick@73
|
192 |
|
patrick@73
|
193 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ matching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
194 |
|
Patrick@161
|
195 |
# ~~~~~~ matching
|
Patrick@169
|
196 |
matching = element matching { matching.attributes, matching.content }
|
Patrick@169
|
197 |
|
Patrick@169
|
198 |
matching.attributes =
|
Patrick@169
|
199 |
multiple.attribute?
|
patrick@75
|
200 |
|
patrick@73
|
201 |
matching.content =
|
patrick@73
|
202 |
match,
|
patrick@73
|
203 |
match+
|
patrick@73
|
204 |
|
Patrick@161
|
205 |
# ~~~~~~ match
|
Patrick@161
|
206 |
match = element match { match.content }
|
Patrick@161
|
207 |
|
Patrick@161
|
208 |
match.content =
|
Patrick@161
|
209 |
match.item,
|
Patrick@161
|
210 |
match.item
|
Patrick@161
|
211 |
|
patrick@73
|
212 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
213 |
|
patrick@73
|
214 |
sort = element sort { sort.attributes, sort.content }
|
patrick@73
|
215 |
|
patrick@73
|
216 |
sort.attributes =
|
patrick@73
|
217 |
shuffle.attribute?
|
patrick@75
|
218 |
|
patrick@73
|
219 |
sort.content =
|
patrick@73
|
220 |
comparison?,
|
patrick@73
|
221 |
sort.item,
|
patrick@73
|
222 |
sort.item+
|
patrick@73
|
223 |
|
patrick@125
|
224 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@125
|
225 |
|
Patrick@310
|
226 |
# ~~~~~~ category.head
|
Patrick@310
|
227 |
category.head = element head { category.head.content }
|
Patrick@310
|
228 |
|
Patrick@310
|
229 |
category.head.content =
|
Patrick@310
|
230 |
title,
|
Patrick@310
|
231 |
shorttitle?,
|
Patrick@310
|
232 |
subtitle*
|
Patrick@310
|
233 |
|
patrick@125
|
234 |
# ~~~~~~ categories
|
Patrick@168
|
235 |
categories = element categories { categories.attributes, categories.content }
|
patrick@125
|
236 |
|
Patrick@168
|
237 |
categories.attributes =
|
Patrick@168
|
238 |
multiple.attribute?
|
Patrick@310
|
239 |
|
patrick@125
|
240 |
categories.content =
|
Patrick@174
|
241 |
category.item*,
|
patrick@125
|
242 |
category,
|
patrick@125
|
243 |
category+
|
patrick@125
|
244 |
|
patrick@125
|
245 |
# ~~~~~~ category
|
patrick@125
|
246 |
category = element category { category.content }
|
patrick@125
|
247 |
|
patrick@125
|
248 |
category.content =
|
patrick@125
|
249 |
category.head,
|
patrick@125
|
250 |
category.item*
|
patrick@125
|
251 |
|
patrick@194
|
252 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pip ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@194
|
253 |
|
patrick@194
|
254 |
pip = element pip { pip.attributes, pip.content }
|
patrick@194
|
255 |
|
patrick@194
|
256 |
pip.attributes =
|
patrick@194
|
257 |
multiple.attribute?
|
patrick@194
|
258 |
|
patrick@194
|
259 |
pip.content =
|
patrick@194
|
260 |
pip.image
|
patrick@194
|
261 |
|
patrick@87
|
262 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ production ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@87
|
263 |
|
patrick@87
|
264 |
production = element production { empty }
|
patrick@87
|
265 |
|
patrick@73
|
266 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
267 |
|
patrick@77
|
268 |
# ~~~~~~ composite
|
Patrick@161
|
269 |
composite = element composite { composite.attributes, composite.content }
|
Patrick@161
|
270 |
|
Patrick@161
|
271 |
composite.attributes =
|
Patrick@161
|
272 |
multipage.attribute?
|
Patrick@310
|
273 |
multipage.attribute = attribute multipage { xsd:boolean }
|
patrick@75
|
274 |
|
patrick@73
|
275 |
composite.content =
|
patrick@85
|
276 |
subquiz,
|
Patrick@154
|
277 |
subquiz+
|
patrick@77
|
278 |
|
patrick@85
|
279 |
# ~~~~~~ subquiz
|
patrick@85
|
280 |
subquiz = element subquiz { subquiz.content }
|
patrick@77
|
281 |
|
patrick@85
|
282 |
subquiz.content =
|
patrick@77
|
283 |
instructions?,
|
Patrick@141
|
284 |
engine,
|
Patrick@141
|
285 |
help?,
|
Patrick@141
|
286 |
answer?
|
patrick@73
|
287 |
|
patrick@73
|
288 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
289 |
|
patrick@73
|
290 |
help = element help { help.content }
|
patrick@73
|
291 |
|
patrick@73
|
292 |
help.content =
|
patrick@73
|
293 |
(section+ | block+)?,
|
patrick@73
|
294 |
link*
|
patrick@73
|
295 |
|
patrick@87
|
296 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ answer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
297 |
|
patrick@87
|
298 |
answer = element answer { answer.content }
|
patrick@73
|
299 |
|
patrick@87
|
300 |
answer.content =
|
patrick@81
|
301 |
(section+ | block+)?,
|
patrick@80
|
302 |
link*
|
patrick@73
|
303 |
|
patrick@73
|
304 |
|
patrick@73
|
305 |
# =============================================================================
|
patrick@73
|
306 |
# BLOCK LEVEL
|
patrick@73
|
307 |
# =============================================================================
|
patrick@73
|
308 |
|
patrick@73
|
309 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
310 |
|
Patrick@313
|
311 |
blanks.block = (
|
Patrick@313
|
312 |
blanks.p | blanks.list | blanks.blockquote | blanks.speech | blanks.table
|
Patrick@313
|
313 |
| blanks.media)
|
Patrick@336
|
314 |
pointing.block = (
|
Patrick@336
|
315 |
pointing.p | pointing.list | pointing.blockquote | pointing.speech
|
Patrick@336
|
316 |
| pointing.table | media)
|
patrick@73
|
317 |
|
patrick@73
|
318 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
319 |
|
patrick@73
|
320 |
blanks.p = element p { blanks.p.content }
|
Patrick@336
|
321 |
pointing.p = element p { pointing.p.content }
|
patrick@73
|
322 |
|
patrick@73
|
323 |
blanks.p.content =
|
patrick@75
|
324 |
blanks.inlines
|
Patrick@336
|
325 |
pointing.p.content =
|
Patrick@336
|
326 |
pointing.inlines
|
patrick@73
|
327 |
|
patrick@73
|
328 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
329 |
|
patrick@73
|
330 |
# ~~~~~~ list
|
patrick@75
|
331 |
blanks.list = element list {
|
patrick@73
|
332 |
block.head?,
|
patrick@73
|
333 |
( (attribute type {"ordered"}?, blanks.item, blanks.item+)
|
patrick@73
|
334 |
| (attribute type {"glossary"}, glossary.item+) )
|
patrick@75
|
335 |
}
|
Patrick@336
|
336 |
pointing.list = element list {
|
patrick@73
|
337 |
block.head?,
|
Patrick@336
|
338 |
( (attribute type {"ordered"}?, pointing.item, pointing.item+)
|
patrick@73
|
339 |
| (attribute type {"glossary"}, glossary.item+) )
|
patrick@75
|
340 |
}
|
patrick@73
|
341 |
|
patrick@73
|
342 |
# ~~~~~~ item
|
patrick@73
|
343 |
blanks.item = element item { blanks.item.content }
|
Patrick@336
|
344 |
pointing.item = element item { pointing.item.content }
|
patrick@73
|
345 |
|
patrick@73
|
346 |
blanks.item.content =
|
patrick@75
|
347 |
blanks.inlines
|
patrick@73
|
348 |
| blanks.block+
|
Patrick@336
|
349 |
pointing.item.content =
|
Patrick@336
|
350 |
pointing.inlines
|
Patrick@336
|
351 |
| pointing.block+
|
patrick@73
|
352 |
|
Patrick@313
|
353 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Patrick@313
|
354 |
|
Patrick@313
|
355 |
blanks.blockquote = element blockquote {
|
Patrick@313
|
356 |
blockquote.attributes, blanks.blockquote.content }
|
Patrick@336
|
357 |
pointing.blockquote = element blockquote {
|
Patrick@336
|
358 |
blockquote.attributes, pointing.blockquote.content }
|
Patrick@313
|
359 |
|
Patrick@313
|
360 |
blanks.blockquote.content =
|
Patrick@313
|
361 |
block.head?,
|
Patrick@313
|
362 |
(blanks.p | speech | blanks.list)+,
|
Patrick@313
|
363 |
attribution?
|
Patrick@336
|
364 |
pointing.blockquote.content =
|
Patrick@313
|
365 |
block.head?,
|
Patrick@336
|
366 |
(pointing.p | speech | pointing.list)+,
|
Patrick@313
|
367 |
attribution?
|
Patrick@313
|
368 |
|
Patrick@313
|
369 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Patrick@313
|
370 |
|
Patrick@313
|
371 |
# ~~~~~~ speech
|
Patrick@313
|
372 |
blanks.speech = element speech { blanks.speech.content }
|
Patrick@336
|
373 |
pointing.speech = element speech { pointing.speech.content }
|
Patrick@313
|
374 |
|
Patrick@313
|
375 |
blanks.speech.content =
|
Patrick@313
|
376 |
blanks.speaker?,
|
Patrick@313
|
377 |
stage?,
|
Patrick@313
|
378 |
(blanks.p | blanks.blockquote)+
|
Patrick@336
|
379 |
pointing.speech.content =
|
Patrick@336
|
380 |
pointing.speaker?,
|
Patrick@313
|
381 |
stage?,
|
Patrick@336
|
382 |
(pointing.p | pointing.blockquote)+
|
Patrick@313
|
383 |
|
Patrick@313
|
384 |
# ~~~~~~ speaker
|
Patrick@313
|
385 |
blanks.speaker = element speaker { blanks.speaker.content }
|
Patrick@336
|
386 |
pointing.speaker = element speaker { pointing.speaker.content }
|
Patrick@313
|
387 |
|
Patrick@313
|
388 |
blanks.speaker.content = blanks.inlines
|
Patrick@336
|
389 |
pointing.speaker.content = pointing.inlines
|
Patrick@313
|
390 |
|
patrick@73
|
391 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
392 |
|
Patrick@313
|
393 |
# ~~~~~~ table
|
patrick@249
|
394 |
blanks.table = element table { table.attributes, blanks.table.content }
|
Patrick@336
|
395 |
pointing.table = element table { table.attributes, pointing.table.content }
|
patrick@73
|
396 |
|
patrick@73
|
397 |
blanks.table.content =
|
patrick@73
|
398 |
block.head?,
|
patrick@249
|
399 |
thead?,
|
patrick@249
|
400 |
(blanks.tbody+ | blanks.tr+),
|
Patrick@313
|
401 |
blanks.table.caption?
|
Patrick@336
|
402 |
pointing.table.content =
|
patrick@73
|
403 |
block.head?,
|
Patrick@336
|
404 |
(pointing.tbody+ | pointing.tr+),
|
Patrick@336
|
405 |
pointing.table.caption?
|
patrick@73
|
406 |
|
patrick@73
|
407 |
# ~~~~~~ tbody
|
patrick@249
|
408 |
blanks.tbody = element tbody { blanks.tbody.content }
|
Patrick@336
|
409 |
pointing.tbody = element tbody { pointing.tbody.content }
|
patrick@73
|
410 |
|
patrick@73
|
411 |
blanks.tbody.content =
|
patrick@249
|
412 |
blanks.tr+
|
Patrick@336
|
413 |
pointing.tbody.content =
|
Patrick@336
|
414 |
pointing.tr+
|
patrick@73
|
415 |
|
patrick@249
|
416 |
# ~~~~~~ tr
|
patrick@249
|
417 |
blanks.tr = element tr { tr.attributes, blanks.tr.content }
|
Patrick@336
|
418 |
pointing.tr = element tr { tr.attributes, pointing.tr.content }
|
patrick@73
|
419 |
|
patrick@249
|
420 |
blanks.tr.content =
|
patrick@249
|
421 |
(blanks.td | blanks.th)+
|
Patrick@336
|
422 |
pointing.tr.content =
|
Patrick@336
|
423 |
(pointing.td | pointing.th)+
|
patrick@73
|
424 |
|
patrick@249
|
425 |
# ~~~~~~ td, th
|
patrick@249
|
426 |
blanks.td = element td { td.attributes, blanks.td.content }
|
patrick@249
|
427 |
blanks.th = element th { td.attributes, blanks.td.content }
|
Patrick@336
|
428 |
pointing.td = element td { td.attributes, pointing.td.content }
|
Patrick@336
|
429 |
pointing.th = element th { td.attributes, pointing.td.content }
|
patrick@73
|
430 |
|
patrick@249
|
431 |
blanks.td.content =
|
patrick@75
|
432 |
blanks.inlines
|
Patrick@313
|
433 |
| (blanks.p | blanks.media)+
|
patrick@73
|
434 |
|
Patrick@336
|
435 |
pointing.td.content =
|
Patrick@336
|
436 |
pointing.inlines
|
Patrick@336
|
437 |
| (pointing.p | media)+
|
Patrick@313
|
438 |
|
Patrick@313
|
439 |
# ~~~~~~ table.caption
|
Patrick@313
|
440 |
blanks.table.caption = element caption { blanks.caption.content }
|
Patrick@336
|
441 |
pointing.table.caption = element caption { pointing.caption.content }
|
Patrick@313
|
442 |
|
Patrick@313
|
443 |
blanks.caption.content =
|
Patrick@313
|
444 |
blanks.inlines
|
Patrick@313
|
445 |
| (blanks.p | speech | blanks.list | blockquote)+
|
Patrick@336
|
446 |
pointing.caption.content =
|
Patrick@336
|
447 |
pointing.inlines
|
Patrick@336
|
448 |
| (pointing.p | speech | pointing.list | blockquote)+
|
patrick@73
|
449 |
|
Patrick@174
|
450 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Patrick@174
|
451 |
|
Patrick@313
|
452 |
# ~~~~~~ media
|
Patrick@313
|
453 |
blanks.media = element media { media.attributes, blanks.media.content }
|
Patrick@336
|
454 |
pointing.media = element media { media.attributes, pointing.media.content }
|
Patrick@174
|
455 |
|
Patrick@313
|
456 |
blanks.media.content =
|
Patrick@174
|
457 |
block.head?,
|
Patrick@174
|
458 |
(blanks.image | audio | video)+,
|
Patrick@313
|
459 |
blanks.media.caption?,
|
Patrick@313
|
460 |
link?
|
Patrick@336
|
461 |
pointing.media.content =
|
Patrick@313
|
462 |
block.head?,
|
Patrick@313
|
463 |
(image | audio | video)+,
|
Patrick@336
|
464 |
pointing.media.caption?,
|
Patrick@174
|
465 |
link?
|
Patrick@174
|
466 |
|
Patrick@174
|
467 |
# ~~~~~~ blanks.image
|
Patrick@174
|
468 |
blanks.image = element image { image.attributes, blanks.image.content }
|
patrick@194
|
469 |
pip.image = element image { image.attributes, pip.image.content }
|
Patrick@174
|
470 |
|
Patrick@174
|
471 |
blanks.image.content =
|
Patrick@174
|
472 |
copyright?,
|
Patrick@192
|
473 |
blanks.dropzone*
|
patrick@194
|
474 |
pip.image.content =
|
patrick@194
|
475 |
pip.dropzone+
|
Patrick@174
|
476 |
|
Patrick@313
|
477 |
# ~~~~~~ dropzone
|
Patrick@192
|
478 |
blanks.dropzone = element dropzone {
|
Patrick@192
|
479 |
blanks.dropzone.attributes, blanks.dropzone.content }
|
patrick@194
|
480 |
pip.dropzone = element dropzone {
|
patrick@194
|
481 |
pip.dropzone.attributes, pip.dropzone.content }
|
Patrick@183
|
482 |
|
Patrick@192
|
483 |
blanks.dropzone.attributes =
|
Patrick@183
|
484 |
x.attribute
|
Patrick@310
|
485 |
& y.attribute
|
patrick@194
|
486 |
pip.dropzone.attributes =
|
patrick@194
|
487 |
x.attribute
|
patrick@194
|
488 |
& y.attribute
|
patrick@194
|
489 |
& w.attribute
|
patrick@194
|
490 |
& h.attribute
|
Patrick@174
|
491 |
|
Patrick@192
|
492 |
blanks.dropzone.content =
|
Patrick@183
|
493 |
blank
|
patrick@194
|
494 |
pip.dropzone.content =
|
patrick@194
|
495 |
image?
|
Patrick@174
|
496 |
|
Patrick@313
|
497 |
# ~~~~~~ media.caption
|
Patrick@313
|
498 |
blanks.media.caption = element caption {
|
Patrick@313
|
499 |
caption.attributes, blanks.caption.content }
|
Patrick@336
|
500 |
pointing.media.caption = element caption {
|
Patrick@336
|
501 |
caption.attributes, pointing.caption.content }
|
Patrick@313
|
502 |
|
patrick@73
|
503 |
# ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
504 |
|
patrick@73
|
505 |
choices.right = element right { choices.right.content }
|
patrick@73
|
506 |
choices.wrong = element wrong { choices.right.content }
|
patrick@73
|
507 |
|
patrick@73
|
508 |
choices.right.content =
|
patrick@73
|
509 |
inlines
|
Patrick@161
|
510 |
| ((p | image | (audio, image?) | video), help?, answer?)
|
patrick@73
|
511 |
|
patrick@73
|
512 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks.wrongs ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
513 |
|
patrick@73
|
514 |
# ~~~~~~ blanks.wrongs
|
patrick@73
|
515 |
blanks.wrongs = element wrongs { blanks.wrongs.content }
|
patrick@73
|
516 |
|
patrick@73
|
517 |
blanks.wrongs.content =
|
Patrick@339
|
518 |
wrongs.wrong+
|
patrick@73
|
519 |
|
Patrick@339
|
520 |
# ~~~~~~ wrongs.wrong
|
Patrick@339
|
521 |
wrongs.wrong = element wrong { wrongs.wrong.content }
|
patrick@73
|
522 |
|
Patrick@339
|
523 |
wrongs.wrong.content = text
|
patrick@73
|
524 |
|
Patrick@313
|
525 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ match.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
526 |
|
Patrick@161
|
527 |
match.item = element item { match.item.content }
|
patrick@73
|
528 |
|
Patrick@161
|
529 |
match.item.content =
|
Patrick@161
|
530 |
inlines
|
patrick@166
|
531 |
| ((p | image | (audio, image?) | video), help?, answer?)
|
patrick@73
|
532 |
|
Patrick@313
|
533 |
# ~~~~~~~~~~~~~~~~~~~~~~~~ comparison, sort.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
534 |
|
patrick@73
|
535 |
# ~~~~~~ comparison
|
patrick@73
|
536 |
comparison = element comparison { comparison.content }
|
patrick@73
|
537 |
|
patrick@73
|
538 |
comparison.content = inlines
|
patrick@73
|
539 |
|
patrick@73
|
540 |
# ~~~~~~ sort.item
|
patrick@73
|
541 |
sort.item = element item { sort.item.attributes, sort.item.content }
|
patrick@73
|
542 |
|
patrick@73
|
543 |
sort.item.attributes =
|
patrick@73
|
544 |
item.shuffle.attribute?
|
patrick@73
|
545 |
item.shuffle.attribute = attribute shuffle { xsd:integer }
|
patrick@73
|
546 |
|
Patrick@161
|
547 |
sort.item.content =
|
Patrick@161
|
548 |
inlines
|
patrick@166
|
549 |
| ((p | image | (audio, image?) | video), help?, answer?)
|
patrick@73
|
550 |
|
Patrick@313
|
551 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ category.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@125
|
552 |
|
patrick@125
|
553 |
category.item = element item { category.item.content }
|
patrick@125
|
554 |
|
Patrick@161
|
555 |
category.item.content =
|
Patrick@161
|
556 |
inlines
|
patrick@166
|
557 |
| ((p | image | (audio, image?) | video), help?, answer?)
|
patrick@125
|
558 |
|
patrick@73
|
559 |
|
patrick@73
|
560 |
# =============================================================================
|
patrick@73
|
561 |
# INLINE LEVEL
|
patrick@73
|
562 |
# =============================================================================
|
patrick@73
|
563 |
|
patrick@75
|
564 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@75
|
565 |
|
Patrick@293
|
566 |
blanks.inlines = mixed {
|
Patrick@293
|
567 |
sup*
|
Patrick@293
|
568 |
& sub*
|
Patrick@293
|
569 |
& var*
|
Patrick@293
|
570 |
& number*
|
Patrick@293
|
571 |
& math*
|
Patrick@293
|
572 |
& date*
|
Patrick@293
|
573 |
& name*
|
Patrick@293
|
574 |
& acronym*
|
Patrick@293
|
575 |
& term*
|
Patrick@293
|
576 |
& warning*
|
Patrick@293
|
577 |
|
Patrick@291
|
578 |
& literal*
|
Patrick@291
|
579 |
& foreign*
|
Patrick@291
|
580 |
& highlight*
|
Patrick@291
|
581 |
& emphasis*
|
Patrick@291
|
582 |
& mentioned*
|
Patrick@291
|
583 |
& stage*
|
Patrick@291
|
584 |
& initial*
|
Patrick@291
|
585 |
& quote*
|
Patrick@291
|
586 |
& image*
|
Patrick@291
|
587 |
& audio*
|
Patrick@291
|
588 |
& smil*
|
Patrick@291
|
589 |
& note*
|
Patrick@291
|
590 |
& link*
|
Patrick@291
|
591 |
& anchor*
|
Patrick@291
|
592 |
& index*
|
Patrick@293
|
593 |
|
patrick@75
|
594 |
& blank*
|
Patrick@293
|
595 |
}
|
Patrick@288
|
596 |
|
Patrick@336
|
597 |
pointing.inlines = mixed {
|
Patrick@293
|
598 |
sup*
|
Patrick@293
|
599 |
& sub*
|
Patrick@293
|
600 |
& var*
|
Patrick@293
|
601 |
& number*
|
Patrick@293
|
602 |
& math*
|
Patrick@293
|
603 |
& date*
|
Patrick@293
|
604 |
& name*
|
Patrick@293
|
605 |
& acronym*
|
Patrick@293
|
606 |
& term*
|
Patrick@293
|
607 |
& warning*
|
Patrick@293
|
608 |
|
Patrick@291
|
609 |
& literal*
|
Patrick@291
|
610 |
& foreign*
|
Patrick@291
|
611 |
& highlight*
|
Patrick@291
|
612 |
& emphasis*
|
Patrick@291
|
613 |
& mentioned*
|
Patrick@291
|
614 |
& stage*
|
Patrick@291
|
615 |
& initial*
|
Patrick@291
|
616 |
& quote*
|
Patrick@291
|
617 |
& image*
|
Patrick@291
|
618 |
& audio*
|
Patrick@291
|
619 |
& smil*
|
Patrick@291
|
620 |
& note*
|
Patrick@291
|
621 |
& link*
|
Patrick@291
|
622 |
& anchor*
|
Patrick@291
|
623 |
& index*
|
Patrick@293
|
624 |
|
Patrick@336
|
625 |
& point*
|
Patrick@293
|
626 |
}
|
patrick@75
|
627 |
|
patrick@73
|
628 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blank ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
629 |
|
patrick@73
|
630 |
# ~~~~~~ blank
|
Patrick@216
|
631 |
blank = element blank { blank.attributes, blank.content }
|
Patrick@216
|
632 |
|
Patrick@216
|
633 |
blank.attributes =
|
Patrick@216
|
634 |
function.attribute?
|
Patrick@216
|
635 |
function.attribute = attribute function { 'lowercase' | 'uppercase' }
|
patrick@73
|
636 |
|
patrick@73
|
637 |
blank.content =
|
patrick@73
|
638 |
text
|
patrick@87
|
639 |
| (s+, help?, answer?)
|
patrick@73
|
640 |
|
patrick@73
|
641 |
# ~~~~~~ s
|
patrick@73
|
642 |
s = element s { s.content }
|
patrick@73
|
643 |
|
patrick@73
|
644 |
s.content = text
|
patrick@73
|
645 |
|
Patrick@336
|
646 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ point ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
patrick@73
|
647 |
|
Patrick@336
|
648 |
point = element point { point.attributes, point.content }
|
patrick@73
|
649 |
|
Patrick@336
|
650 |
point.attributes =
|
Patrick@336
|
651 |
point.ref.attribute?
|
Patrick@340
|
652 |
point.ref.attribute = attribute ref {
|
Patrick@340
|
653 |
"right" | "cat1" | "cat2" | "cat3" | "cat4" | "cat5" }
|
Patrick@336
|
654 |
|
Patrick@336
|
655 |
point.content = simple.inlines
|