RelaxNG/publiquiz.rnc
changeset 313 e4f154ea2837
parent 310 13939fb7824a
child 336 15beef04b08c
equal deleted inserted replaced
312:7f6b762880b4 313:e4f154ea2837
   272 #                                 BLOCK LEVEL
   272 #                                 BLOCK LEVEL
   273 # =============================================================================
   273 # =============================================================================
   274 
   274 
   275 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   275 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   276 
   276 
   277 blanks.block =
   277 blanks.block = (
   278    (blanks.p | speech | blanks.list | blockquote | blanks.table | blanks.media)
   278    blanks.p | blanks.list | blanks.blockquote | blanks.speech | blanks.table
   279 point.block =
   279  | blanks.media)
   280    (point.p | speech | point.list | blockquote | point.table | media)
   280 point.block = (
       
   281    point.p | point.list | point.blockquote | point.speech | point.table | media)
   281 
   282 
   282 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   283 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   283 
   284 
   284 blanks.p = element p { blanks.p.content }
   285 blanks.p = element p { blanks.p.content }
   285 point.p = element p { point.p.content }
   286 point.p = element p { point.p.content }
   312  | blanks.block+
   313  | blanks.block+
   313 point.item.content =
   314 point.item.content =
   314    point.inlines
   315    point.inlines
   315  | point.block+
   316  | point.block+
   316 
   317 
       
   318 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   319 
       
   320 blanks.blockquote = element blockquote {
       
   321    blockquote.attributes, blanks.blockquote.content }
       
   322 point.blockquote = element blockquote {
       
   323    blockquote.attributes, point.blockquote.content }
       
   324 
       
   325 blanks.blockquote.content =
       
   326    block.head?,
       
   327    (blanks.p | speech | blanks.list)+,
       
   328    attribution?
       
   329 point.blockquote.content =
       
   330    block.head?,
       
   331    (point.p | speech | point.list)+,
       
   332    attribution?
       
   333 
       
   334 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   335 
       
   336 # ~~~~~~ speech
       
   337 blanks.speech = element speech { blanks.speech.content }
       
   338 point.speech = element speech { point.speech.content }
       
   339 
       
   340 blanks.speech.content =
       
   341    blanks.speaker?,
       
   342    stage?,
       
   343    (blanks.p | blanks.blockquote)+
       
   344 point.speech.content =
       
   345    point.speaker?,
       
   346    stage?,
       
   347    (point.p | point.blockquote)+
       
   348 
       
   349 # ~~~~~~ speaker
       
   350 blanks.speaker = element speaker { blanks.speaker.content }
       
   351 point.speaker = element speaker { point.speaker.content }
       
   352 
       
   353 blanks.speaker.content = blanks.inlines
       
   354 point.speaker.content = point.inlines
       
   355 
   317 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   356 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   318 
   357 
       
   358 # ~~~~~~ table
   319 blanks.table = element table { table.attributes, blanks.table.content }
   359 blanks.table = element table { table.attributes, blanks.table.content }
   320 point.table = element table { table.attributes, point.table.content }
   360 point.table = element table { table.attributes, point.table.content }
   321 
   361 
   322 blanks.table.content =
   362 blanks.table.content =
   323    block.head?,
   363    block.head?,
   324    thead?,
   364    thead?,
   325    (blanks.tbody+ | blanks.tr+),
   365    (blanks.tbody+ | blanks.tr+),
   326    table.caption?
   366    blanks.table.caption?
   327 point.table.content =
   367 point.table.content =
   328    block.head?,
   368    block.head?,
   329    (point.tbody+ | point.tr+),
   369    (point.tbody+ | point.tr+),
   330    table.caption?
   370    point.table.caption?
   331 
   371 
   332 # ~~~~~~ tbody
   372 # ~~~~~~ tbody
   333 blanks.tbody = element tbody { blanks.tbody.content }
   373 blanks.tbody = element tbody { blanks.tbody.content }
   334 point.tbody = element tbody { point.tbody.content }
   374 point.tbody = element tbody { point.tbody.content }
   335 
   375 
   353 point.td = element td { td.attributes, point.td.content }
   393 point.td = element td { td.attributes, point.td.content }
   354 point.th = element th { td.attributes, point.td.content }
   394 point.th = element th { td.attributes, point.td.content }
   355 
   395 
   356 blanks.td.content =
   396 blanks.td.content =
   357    blanks.inlines
   397    blanks.inlines
   358  | (p | media)+
   398  | (blanks.p | blanks.media)+
   359 
   399 
   360 point.td.content =
   400 point.td.content =
   361    point.inlines
   401    point.inlines
   362  | (p | media)+
   402  | (point.p | media)+
       
   403 
       
   404 # ~~~~~~ table.caption
       
   405 blanks.table.caption = element caption { blanks.caption.content }
       
   406 point.table.caption = element caption { point.caption.content }
       
   407 
       
   408 blanks.caption.content =
       
   409    blanks.inlines
       
   410  | (blanks.p | speech | blanks.list | blockquote)+
       
   411 point.caption.content =
       
   412    point.inlines
       
   413  | (point.p | speech | point.list | blockquote)+
   363 
   414 
   364 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   415 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   365 
   416 
   366 # ~~~~~~ blanks.media
   417 # ~~~~~~ media
   367 blanks.media = element media { media.attributes, blanksmedia.content }
   418 blanks.media = element media { media.attributes, blanks.media.content }
   368 
   419 point.media = element media { media.attributes, point.media.content }
   369 blanksmedia.content =
   420 
       
   421 blanks.media.content =
   370    block.head?,
   422    block.head?,
   371    (blanks.image | audio | video)+,
   423    (blanks.image | audio | video)+,
   372    media.caption?,
   424    blanks.media.caption?,
       
   425    link?
       
   426 point.media.content =
       
   427    block.head?,
       
   428    (image | audio | video)+,
       
   429    point.media.caption?,
   373    link?
   430    link?
   374 
   431 
   375 # ~~~~~~ blanks.image
   432 # ~~~~~~ blanks.image
   376 blanks.image = element image { image.attributes, blanks.image.content }
   433 blanks.image = element image { image.attributes, blanks.image.content }
   377 pip.image = element image { image.attributes, pip.image.content }
   434 pip.image = element image { image.attributes, pip.image.content }
   380    copyright?,
   437    copyright?,
   381    blanks.dropzone*
   438    blanks.dropzone*
   382 pip.image.content =
   439 pip.image.content =
   383    pip.dropzone+
   440    pip.dropzone+
   384 
   441 
   385 # ~~~~~~dropzone
   442 # ~~~~~~ dropzone
   386 blanks.dropzone = element dropzone {
   443 blanks.dropzone = element dropzone {
   387    blanks.dropzone.attributes, blanks.dropzone.content }
   444    blanks.dropzone.attributes, blanks.dropzone.content }
   388 pip.dropzone = element dropzone {
   445 pip.dropzone = element dropzone {
   389    pip.dropzone.attributes, pip.dropzone.content }
   446    pip.dropzone.attributes, pip.dropzone.content }
   390 
   447 
   400 blanks.dropzone.content =
   457 blanks.dropzone.content =
   401    blank
   458    blank
   402 pip.dropzone.content =
   459 pip.dropzone.content =
   403    image?
   460    image?
   404 
   461 
       
   462 # ~~~~~~ media.caption
       
   463 blanks.media.caption = element caption {
       
   464    caption.attributes, blanks.caption.content }
       
   465 point.media.caption = element caption {
       
   466    caption.attributes, point.caption.content }
       
   467 
   405 # ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~
   468 # ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~
   406 
   469 
   407 choices.right = element right { choices.right.content }
   470 choices.right = element right { choices.right.content }
   408 choices.wrong = element wrong { choices.right.content }
   471 choices.wrong = element wrong { choices.right.content }
   409 
   472 
   422 # ~~~~~~ blanks.wrong
   485 # ~~~~~~ blanks.wrong
   423 blanks.wrong = element wrong { blanks.wrong.content }
   486 blanks.wrong = element wrong { blanks.wrong.content }
   424 
   487 
   425 blanks.wrong.content = text
   488 blanks.wrong.content = text
   426 
   489 
   427 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (match) item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   490 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ match.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   428 
   491 
   429 match.item = element item { match.item.content }
   492 match.item = element item { match.item.content }
   430 
   493 
   431 match.item.content =
   494 match.item.content =
   432    inlines
   495    inlines
   433  | ((p | image | (audio, image?) | video), help?, answer?)
   496  | ((p | image | (audio, image?) | video), help?, answer?)
   434 
   497 
   435 # ~~~~~~~~~~~~~~~~~~~~~~~~ (sort) comparison, item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   498 # ~~~~~~~~~~~~~~~~~~~~~~~~ comparison, sort.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   436 
   499 
   437 # ~~~~~~ comparison
   500 # ~~~~~~ comparison
   438 comparison = element comparison { comparison.content }
   501 comparison = element comparison { comparison.content }
   439 
   502 
   440 comparison.content = inlines
   503 comparison.content = inlines
   448 
   511 
   449 sort.item.content =
   512 sort.item.content =
   450    inlines
   513    inlines
   451  | ((p | image | (audio, image?) | video), help?, answer?)
   514  | ((p | image | (audio, image?) | video), help?, answer?)
   452 
   515 
   453 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (category) item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   516 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ category.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   454 
   517 
   455 category.item = element item { category.item.content }
   518 category.item = element item { category.item.content }
   456 
   519 
   457 category.item.content =
   520 category.item.content =
   458    inlines
   521    inlines