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