RelaxNG/publidoc.rnc
author iinov
ven., 19 oct. 2018 18:19:27 +0200
changeset 464 968d3380597e
parent 460 7e0c719c9526
child 476 6c30a3543cd8
permissions -rw-r--r--
Texte Houston
patrick@0
     1
patrick@0
     2
start = publidoc
patrick@0
     3
patrick@0
     4
publidoc = element publidoc {
patrick@0
     5
   publidoc.attributes,
patrick@0
     6
   publidoc.content
patrick@0
     7
}
patrick@0
     8
patrick@0
     9
publidoc.attributes =
patrick@0
    10
   version.attribute
patrick@0
    11
version.attribute = attribute version { "1.0" }
patrick@0
    12
patrick@0
    13
publidoc.content =
patrick@0
    14
   document
patrick@0
    15
 | top.topic
Coraline@419
    16
 | glossary
patrick@0
    17
patrick@0
    18
# =============================================================================
Patrick@310
    19
#                                 HEAD LEVEL
Patrick@310
    20
# =============================================================================
Patrick@310
    21
Patrick@310
    22
# ~~~~~~~~~~~~~~~~~~~~~~~ title, shorttitle, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
    23
Patrick@310
    24
title = element title { title.content }
Patrick@310
    25
shorttitle = element shorttitle { title.content }
Patrick@310
    26
subtitle = element subtitle { title.content }
Patrick@310
    27
Patrick@310
    28
title.content = inlines
Patrick@310
    29
Patrick@310
    30
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
    31
Patrick@310
    32
# ~~~~~~ identifier
Patrick@310
    33
identifier = element identifier {
Patrick@310
    34
   (attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"})
Patrick@310
    35
 | (attribute type { "uri" }, for.attribute?, xsd:anyURI)
Patrick@310
    36
}
Patrick@310
    37
Patrick@310
    38
# ~~~~~~ identifier.ean
Patrick@310
    39
identifier.ean = element identifier {
Patrick@310
    40
   attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"}
Patrick@310
    41
}
Patrick@310
    42
Patrick@310
    43
# ~~~~~~ identifier.uri
Patrick@310
    44
identifier.uri = element identifier {
Patrick@310
    45
   attribute type { "uri" }, for.attribute?, xsd:anyURI
Patrick@310
    46
}
Patrick@310
    47
Patrick@310
    48
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
    49
Patrick@310
    50
copyright = element copyright { copyright.content }
Patrick@310
    51
Patrick@310
    52
copyright.content = simple.inlines
Patrick@310
    53
Patrick@310
    54
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ collection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
    55
Patrick@310
    56
collection = element collection { collection.content }
Patrick@310
    57
Patrick@310
    58
collection.content = simple.inlines
Patrick@310
    59
Patrick@310
    60
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ contributors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
    61
Patrick@310
    62
# ~~~~~~ contributors
Patrick@310
    63
contributors = element contributors { contributors.content }
Patrick@310
    64
Patrick@310
    65
contributors.content =
Patrick@310
    66
   contributor+
Patrick@310
    67
Patrick@310
    68
# ~~~~~~ contributor
Patrick@310
    69
contributor = element contributor { contributor.content }
Patrick@310
    70
Patrick@310
    71
contributor.content =
Patrick@310
    72
   identifier.uri?,
Patrick@350
    73
   ((firstname?, lastname) | label),
Patrick@310
    74
   address?,
Patrick@310
    75
   link?,
Patrick@310
    76
   role+
Patrick@310
    77
Patrick@310
    78
# ~~~~~~ firstname, secondname, lastname, label
Patrick@310
    79
firstname = element firstname { firstname.content }
Patrick@310
    80
lastname = element lastname { lastname.content }
Patrick@310
    81
label = element label { label.content }
Patrick@310
    82
Patrick@310
    83
firstname.content = simple.inlines
Patrick@310
    84
lastname.content = simple.inlines
Patrick@310
    85
label.content = simple.inlines
Patrick@310
    86
Patrick@310
    87
# ~~~~~~ address
Patrick@310
    88
address = element address { address.content }
Patrick@310
    89
Patrick@310
    90
address.content = simple.inlines
Patrick@310
    91
Patrick@310
    92
# ~~~~~~ role
Patrick@310
    93
role = element role { role.content }
Patrick@310
    94
Patrick@310
    95
role.content = "author" | "illustrator" | "publisher" | "packager"
Coraline@416
    96
 | "translator"
Patrick@310
    97
Patrick@310
    98
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
    99
Patrick@310
   100
place = element place { place.content }
Patrick@310
   101
Patrick@310
   102
place.content = simple.inlines
Patrick@310
   103
Patrick@310
   104
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
   105
Patrick@310
   106
source = element source {
Patrick@310
   107
   (  (attribute type { "book" }, bibliography.entry.content)
Patrick@310
   108
    | (attribute type { "file" }, source.content.file)),
Patrick@310
   109
   source.content
Patrick@310
   110
}
Patrick@310
   111
Patrick@310
   112
source.content.file =
Patrick@310
   113
   identifier.uri
Patrick@310
   114
source.content =
Patrick@364
   115
   annotation?
Patrick@310
   116
Patrick@310
   117
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
   118
Patrick@310
   119
# ~~~~~~ keywordset
Patrick@310
   120
keywordset = element keywordset { keywordset.content }
Patrick@310
   121
Patrick@310
   122
keywordset.content = keyword+
Patrick@310
   123
Patrick@310
   124
# ~~~~~~ keyword
Patrick@310
   125
keyword = element keyword { keyword.content }
Patrick@310
   126
Patrick@310
   127
keyword.content = simple.inlines
Patrick@310
   128
Patrick@310
   129
# ~~~~~~ subjectset
Patrick@310
   130
subjectset = element subjectset { subjectset.content }
Patrick@310
   131
Patrick@310
   132
subjectset.content = subject+
Patrick@310
   133
Patrick@310
   134
# ~~~~~~ subject
Patrick@310
   135
subject = element subject { subject.content }
Patrick@310
   136
Patrick@310
   137
subject.content = simple.inlines
Patrick@310
   138
Patrick@310
   139
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ index ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
   140
Patrick@355
   141
# ~~~~~~ indexset
Patrick@355
   142
indexset = element indexset { indexset.content }
Patrick@355
   143
Patrick@355
   144
indexset.content = head.index+
Patrick@355
   145
Patrick@310
   146
# ~~~~~~ index
Patrick@310
   147
index = element index { index.content }
Patrick@310
   148
head.index = element index { head.index.content }
Patrick@310
   149
Patrick@310
   150
index.content =
Patrick@310
   151
   (index.w, index.entry?)
Patrick@310
   152
 | (index.entry, (index.w | index.entry)?)
Patrick@310
   153
head.index.content =
Patrick@310
   154
   index.entry, index.entry?
Patrick@310
   155
Patrick@310
   156
# ~~~~~~ index.w
Patrick@310
   157
index.w = element w { simple.inlines }
Patrick@310
   158
Patrick@310
   159
# ~~~~~~ index.entry
Patrick@310
   160
index.entry = element entry { simple.inlines }
Patrick@310
   161
Patrick@310
   162
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
   163
Patrick@310
   164
abstract = element abstract { abstract.content }
Patrick@310
   165
Patrick@310
   166
abstract.content =
Patrick@310
   167
   p+
Patrick@310
   168
Patrick@310
   169
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
   170
Patrick@310
   171
cover = element cover { cover.content }
Patrick@310
   172
Patrick@310
   173
cover.content =
Patrick@310
   174
   cover.image
Patrick@310
   175
Patrick@310
   176
cover.image = element image { cover.image.attributes }
Patrick@310
   177
Patrick@310
   178
cover.image.attributes =
Patrick@310
   179
   media.id.attribute
Patrick@310
   180
Patrick@310
   181
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
   182
Patrick@310
   183
annotation = element annotation { annotation.content }
Patrick@310
   184
Patrick@364
   185
annotation.content =
Patrick@364
   186
   inlines | p+
Patrick@310
   187
Patrick@310
   188
Patrick@310
   189
# =============================================================================
patrick@20
   190
#                                  TOP LEVEL
patrick@0
   191
# =============================================================================
patrick@0
   192
patrick@98
   193
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   194
patrick@90
   195
top.head = element head { top.head.content }
patrick@90
   196
patrick@90
   197
top.head.content =
Patrick@384
   198
   (title & shorttitle? & subtitle*)?
Patrick@256
   199
 & identifier*
patrick@181
   200
 & copyright*
Patrick@155
   201
 & collection?
patrick@90
   202
 & contributors?
patrick@90
   203
 & date?
patrick@90
   204
 & place?
patrick@156
   205
 & (source, source?)?
patrick@90
   206
 & keywordset?
patrick@90
   207
 & subjectset?
Patrick@355
   208
 & indexset?
patrick@90
   209
 & abstract?
patrick@90
   210
 & cover?
Patrick@364
   211
 & annotation?
patrick@90
   212
patrick@0
   213
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   214
patrick@0
   215
document = element document { document.attributes, document.content }
patrick@0
   216
patrick@0
   217
document.attributes =
Patrick@388
   218
   document.id.attribute?
patrick@142
   219
 & document.type.attribute?
patrick@66
   220
 & lang.attribute?
patrick@117
   221
document.id.attribute = attribute id { xsd:NMTOKEN }
patrick@142
   222
document.type.attribute = attribute type { xsd:NCName }
patrick@66
   223
lang.attribute = attribute xml:lang { xsd:language }
patrick@0
   224
patrick@0
   225
document.content =
patrick@20
   226
   top.head?,
Coraline@419
   227
   (division | topic | glossary)+
patrick@0
   228
Patrick@310
   229
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   230
patrick@18
   231
top.topic = element topic { top.topic.attributes, top.topic.content }
patrick@0
   232
patrick@20
   233
top.topic.attributes =
Patrick@388
   234
   topic.id.attribute?
patrick@20
   235
 & topic.type.attribute?
patrick@66
   236
 & lang.attribute?
patrick@117
   237
topic.id.attribute = attribute id { xsd:NMTOKEN }
patrick@20
   238
topic.type.attribute = attribute type { xsd:NCName }
patrick@20
   239
patrick@20
   240
top.topic.content =
patrick@20
   241
   top.head?,
Patrick@137
   242
   header?,
Patrick@190
   243
   ((section+, bibliography?) | bibliography),
Patrick@137
   244
   footer?
patrick@0
   245
Patrick@446
   246
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glossary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@419
   247
Coraline@419
   248
glossary = element glossary { glossary.attributes, glossary.content }
Coraline@419
   249
Coraline@419
   250
glossary.attributes =
Coraline@419
   251
   glossary.type.attribute?
Coraline@425
   252
 & lang.attribute?
Coraline@419
   253
 & langto.attribute?
Coraline@419
   254
glossary.type.attribute = attribute type { xsd:NCName }
Coraline@419
   255
langto.attribute = attribute langto { xsd:language }
Coraline@419
   256
Coraline@419
   257
glossary.content =
Coraline@419
   258
   glossary.entry+
Coraline@419
   259
Coraline@419
   260
patrick@0
   261
# =============================================================================
patrick@20
   262
#                                 DIVISION LEVEL
patrick@0
   263
# =============================================================================
patrick@0
   264
Patrick@310
   265
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
   266
Patrick@310
   267
division.head = element head { division.head.content }
Patrick@310
   268
Patrick@310
   269
division.head.content =
Patrick@384
   270
   (title & shorttitle? & subtitle*)?
Patrick@355
   271
 & indexset?
Patrick@310
   272
 & abstract?
Patrick@364
   273
 & annotation?
Patrick@310
   274
patrick@70
   275
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   276
Patrick@232
   277
division = element division { division.attributes, division.content }
Patrick@232
   278
Patrick@232
   279
division.attributes =
Patrick@232
   280
   division.type.attribute?
Patrick@232
   281
division.type.attribute = attribute type { xsd:NCName }
patrick@0
   282
patrick@0
   283
division.content =
patrick@20
   284
   division.head?,
Patrick@217
   285
   front?,
patrick@56
   286
   (division | topic)+
patrick@0
   287
Patrick@310
   288
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ front ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   289
Patrick@217
   290
front = element front { front.content }
Patrick@217
   291
Patrick@217
   292
front.content =
Patrick@217
   293
   section+
Patrick@217
   294
patrick@0
   295
patrick@0
   296
# =============================================================================
patrick@90
   297
#                                COMPONENT LEVEL
patrick@0
   298
# =============================================================================
patrick@0
   299
patrick@90
   300
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ component.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   301
patrick@90
   302
component.head = element head { component.head.content }
patrick@90
   303
patrick@90
   304
component.head.content =
Patrick@384
   305
   (title & shorttitle? & subtitle*)?
patrick@90
   306
 & contributors?
patrick@143
   307
 & date?
patrick@143
   308
 & place?
patrick@143
   309
 & keywordset?
patrick@143
   310
 & subjectset?
Patrick@355
   311
 & indexset?
patrick@90
   312
 & abstract?
Patrick@364
   313
 & annotation?
patrick@90
   314
patrick@0
   315
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   316
patrick@0
   317
topic = element topic { topic.attributes, topic.content }
patrick@0
   318
patrick@0
   319
topic.attributes =
Patrick@191
   320
   (topic.id.attribute | xmlid.attribute)?
patrick@0
   321
 & topic.type.attribute?
patrick@69
   322
 & lang.attribute?
Patrick@191
   323
xmlid.attribute = attribute xml:id { xsd:ID }
patrick@0
   324
patrick@0
   325
topic.content =
patrick@20
   326
   component.head?,
Patrick@137
   327
   header?,
Patrick@190
   328
   ((section+, bibliography?) | bibliography),
Patrick@137
   329
   footer?
patrick@0
   330
patrick@0
   331
patrick@0
   332
# =============================================================================
patrick@20
   333
#                                 SECTION LEVEL
patrick@0
   334
# =============================================================================
patrick@0
   335
Patrick@310
   336
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
   337
Patrick@310
   338
section.head = element head { section.head.content }
Patrick@310
   339
Patrick@310
   340
section.head.content =
Patrick@384
   341
   (title & shorttitle? & subtitle*)?
Patrick@310
   342
 & keywordset?
Patrick@310
   343
 & subjectset?
Patrick@355
   344
 & indexset?
Patrick@310
   345
 & abstract?
Patrick@310
   346
 & audio*
Patrick@364
   347
 & annotation?
Patrick@310
   348
Patrick@137
   349
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@137
   350
Patrick@137
   351
header = element header { header.content }
Patrick@137
   352
Patrick@137
   353
header.content =
Patrick@137
   354
   block+
Patrick@137
   355
patrick@20
   356
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   357
patrick@58
   358
section = element section { section.attributes, section.content }
patrick@58
   359
patrick@58
   360
section.attributes =
Patrick@279
   361
   xmlid.attribute?
Patrick@279
   362
 & section.type.attribute?
patrick@64
   363
 & lang.attribute?
patrick@166
   364
 & for.attribute?
patrick@58
   365
section.type.attribute = attribute type { xsd:NCName }
patrick@166
   366
for.attribute = attribute for { xsd:NCName }
patrick@0
   367
patrick@0
   368
section.content =
patrick@20
   369
   section.head?,
patrick@9
   370
   (section+ | block+)
patrick@0
   371
Patrick@189
   372
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@189
   373
Patrick@189
   374
bibliography = element bibliography { bibliography.content }
Patrick@189
   375
Patrick@189
   376
bibliography.content =
Patrick@189
   377
   bibliography.entry+
Patrick@189
   378
Patrick@137
   379
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@137
   380
Patrick@137
   381
footer = element footer { footer.content }
Patrick@137
   382
Patrick@137
   383
footer.content =
Patrick@137
   384
   block+
Patrick@137
   385
Coraline@419
   386
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glossary.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@446
   387
Coraline@419
   388
# ~~~~~~ glossary.entry
Coraline@419
   389
glossary.entry= element entry {
Coraline@419
   390
   glossary.entry.attributes, glossary.entry.content }
Coraline@419
   391
Coraline@419
   392
glossary.entry.attributes =
Coraline@425
   393
   xmlid.attribute?
Coraline@419
   394
Coraline@419
   395
glossary.entry.content =
Coraline@419
   396
   mainterm,
Coraline@427
   397
   alt-terms?,
Coraline@423
   398
   media?,
Coraline@419
   399
   meanings+,
Coraline@419
   400
   seealso*
Coraline@419
   401
Coraline@419
   402
# ~~~~~~ mainterm
Coraline@419
   403
mainterm = element mainterm { mainterm.content }
Patrick@446
   404
Coraline@419
   405
mainterm.content = simple.inlines
patrick@0
   406
Coraline@425
   407
# ~~~~~~ alt-terms
Coraline@425
   408
alt-terms = element alt-terms { alt-terms.content }
Patrick@446
   409
Patrick@446
   410
alt-terms.content =
Patrick@446
   411
    alt-term+
Coraline@425
   412
Coraline@425
   413
# ~~~~~~ alt-term
Coraline@426
   414
alt-term = element alt-term { alt-term.attributes, alt-term.content }
Patrick@446
   415
Coraline@425
   416
alt-term.content = inlines
Coraline@425
   417
Patrick@446
   418
alt-term.attributes =
Patrick@446
   419
    alt-term.type.attribute?
Coraline@426
   420
alt-term.type.attribute = attribute type { xsd:NCName }
Coraline@426
   421
Patrick@446
   422
patrick@0
   423
# =============================================================================
patrick@20
   424
#                                 BLOCK LEVEL
patrick@0
   425
# =============================================================================
patrick@0
   426
Patrick@310
   427
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@9
   428
patrick@90
   429
block.head = element head { block.head.content }
patrick@90
   430
patrick@90
   431
block.head.content =
Patrick@384
   432
   (title & shorttitle? & subtitle*)?
Patrick@355
   433
 & indexset?
Patrick@364
   434
 & annotation?
patrick@90
   435
Patrick@310
   436
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@310
   437
Patrick@313
   438
block = (p | \list | blockquote | speech | table | table.cals | media)
Patrick@310
   439
patrick@42
   440
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   441
patrick@20
   442
p = element p { p.content }
patrick@0
   443
patrick@20
   444
p.content =
patrick@0
   445
   inlines
patrick@0
   446
patrick@17
   447
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@9
   448
patrick@9
   449
# ~~~~~~ list
patrick@75
   450
\list = element list {
patrick@20
   451
   block.head?,
patrick@71
   452
   (  (attribute type {"ordered"}?, item, item+)
Coraline@419
   453
    | (attribute type {"glossary"}, item.glossary+) )
patrick@75
   454
}
patrick@9
   455
patrick@9
   456
# ~~~~~~ item
patrick@9
   457
item = element item { item.content }
patrick@9
   458
patrick@30
   459
item.content =
patrick@73
   460
   inlines
patrick@73
   461
 | block+
patrick@9
   462
Coraline@419
   463
# ~~~~~~ item.glossary
Coraline@419
   464
item.glossary = element item { item.glossary.content }
patrick@9
   465
Coraline@419
   466
item.glossary.content =
patrick@9
   467
   label,
patrick@9
   468
   block+
patrick@9
   469
patrick@44
   470
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@44
   471
patrick@44
   472
# ~~~~~~ blockquote
Patrick@306
   473
blockquote = element blockquote { blockquote.attributes, blockquote.content }
patrick@44
   474
Patrick@306
   475
blockquote.attributes =
Patrick@306
   476
   blockquote.type.attribute?
Patrick@306
   477
blockquote.type.attribute = attribute type { xsd:NCName }
Patrick@310
   478
patrick@44
   479
blockquote.content =
patrick@44
   480
   block.head?,
patrick@44
   481
   (p | speech | \list)+,
patrick@44
   482
   attribution?
patrick@44
   483
patrick@44
   484
# ~~~~~~ attribution
patrick@72
   485
attribution = element attribution { attribution.content }
patrick@44
   486
Patrick@225
   487
attribution.content = mixed {
Patrick@225
   488
   sup* & number* & date* & name* & foreign* & acronym* & term* & literal*
Patrick@238
   489
 & highlight* & emphasis* & mentioned* & note* & warning* }
patrick@44
   490
Patrick@313
   491
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@313
   492
Patrick@313
   493
# ~~~~~~ speech
Patrick@313
   494
speech = element speech { speech.content }
Patrick@313
   495
Patrick@313
   496
speech.content =
Patrick@313
   497
   speaker?,
Patrick@313
   498
   stage?,
Patrick@313
   499
   (p | blockquote)+
Patrick@313
   500
Patrick@313
   501
# ~~~~~~ speaker
Patrick@313
   502
speaker = element speaker { speaker.content }
Patrick@313
   503
Patrick@313
   504
speaker.content = inlines
Patrick@313
   505
patrick@248
   506
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@17
   507
patrick@73
   508
# ~~~~~~ table
patrick@248
   509
table = element table { table.attributes, table.content }
patrick@248
   510
patrick@248
   511
table.attributes =
patrick@248
   512
   table.type.attribute?
patrick@248
   513
table.type.attribute = attribute type { xsd:NCName }
patrick@17
   514
patrick@17
   515
table.content =
patrick@20
   516
   block.head?,
Patrick@358
   517
   ((thead?, tbody+) | tr+),
patrick@109
   518
   table.caption?
patrick@17
   519
patrick@248
   520
# ~~~~~~ thead, tbody
patrick@248
   521
thead = element thead { thead.content }
patrick@248
   522
tbody = element tbody { tbody.content }
patrick@17
   523
patrick@248
   524
thead.content =
patrick@248
   525
   tr+
patrick@248
   526
tbody.content =
patrick@248
   527
   tr+
patrick@17
   528
patrick@248
   529
# ~~~~~~ tr
patrick@248
   530
tr = element tr { tr.attributes, tr.content }
patrick@248
   531
patrick@248
   532
tr.attributes =
patrick@248
   533
   align.attribute?
patrick@248
   534
 & valign.attribute?
Tiphanie@309
   535
 & cell.type.attribute?
patrick@17
   536
align.attribute = attribute align { "left"  |  "right"  | "center" | "justify" }
patrick@22
   537
valign.attribute = attribute valign { "top" | "middle" | "bottom" }
Tiphanie@309
   538
cell.type.attribute = attribute type { xsd:NCName }
patrick@75
   539
patrick@248
   540
tr.content =
patrick@248
   541
   (td | th)+
patrick@17
   542
patrick@248
   543
# ~~~~~~ td, th
patrick@248
   544
td = element td { td.attributes, td.content }
patrick@248
   545
th = element th { td.attributes, td.content }
patrick@17
   546
patrick@248
   547
td.attributes =
patrick@146
   548
   align.attribute?
patrick@146
   549
 & valign.attribute?
patrick@248
   550
 & colspan.attribute?
patrick@248
   551
 & rowspan.attribute?
Tiphanie@309
   552
 & cell.type.attribute?
patrick@248
   553
colspan.attribute = attribute colspan { xsd:positiveInteger }
patrick@248
   554
rowspan.attribute = attribute rowspan { xsd:positiveInteger }
patrick@17
   555
patrick@248
   556
td.content =
patrick@17
   557
   inlines
patrick@37
   558
 | (p | media)+
patrick@17
   559
patrick@109
   560
# ~~~~~~ table.caption
patrick@109
   561
table.caption = element caption { caption.content }
patrick@17
   562
patrick@17
   563
caption.content =
patrick@20
   564
   inlines
Patrick@138
   565
 | (p | speech | \list | blockquote)+
patrick@17
   566
patrick@248
   567
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table.cals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@248
   568
patrick@248
   569
# ~~~~~~ table.cals
patrick@248
   570
table.cals = element table { table.attributes, table.cals.content }
patrick@248
   571
patrick@248
   572
table.cals.content =
patrick@248
   573
   block.head?,
patrick@248
   574
   tgroup+,
patrick@248
   575
   table.caption?
patrick@248
   576
patrick@248
   577
# ~~~~~~ tgroup
patrick@248
   578
tgroup = element tgroup { tgroup.attributes, tgroup.content }
patrick@248
   579
patrick@248
   580
tgroup.attributes =
patrick@248
   581
   cols.attribute
patrick@248
   582
cols.attribute = attribute cols { xsd:positiveInteger }
patrick@248
   583
patrick@248
   584
tgroup.content =
patrick@248
   585
   thead.cals?,
patrick@248
   586
   tbody.cals
patrick@248
   587
patrick@248
   588
# ~~~~~~ thead, tbody
patrick@248
   589
thead.cals = element thead { thead.cals.content }
patrick@248
   590
tbody.cals = element tbody { tbody.cals.content }
patrick@248
   591
patrick@248
   592
thead.cals.content =
patrick@248
   593
   row+
patrick@248
   594
tbody.cals.content =
patrick@248
   595
   row+
patrick@248
   596
patrick@248
   597
# ~~~~~~ row
patrick@248
   598
row = element row { row.attributes, row.content }
patrick@248
   599
patrick@248
   600
row.attributes =
patrick@248
   601
   valign.attribute?
patrick@248
   602
patrick@248
   603
row.content =
patrick@248
   604
  table.cals.entry+
patrick@248
   605
patrick@248
   606
# ~~~~~~ table.cals.entry
patrick@248
   607
table.cals.entry = element entry {
patrick@248
   608
   table.cals.entry.attributes, table.cals.entry.content }
patrick@248
   609
patrick@248
   610
table.cals.entry.attributes =
patrick@248
   611
   align.attribute?
patrick@248
   612
 & valign.attribute?
patrick@248
   613
patrick@248
   614
table.cals.entry.content =
patrick@248
   615
   inlines
patrick@248
   616
 | (p | media)+
patrick@248
   617
patrick@35
   618
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   619
patrick@2
   620
# ~~~~~~ media
patrick@245
   621
media = element media { media.attributes, media.content }
patrick@245
   622
patrick@245
   623
media.attributes =
Patrick@279
   624
   xmlid.attribute?
Patrick@279
   625
 & media.type.attribute?
patrick@245
   626
media.type.attribute = attribute type { xsd:NCName }
patrick@0
   627
patrick@0
   628
media.content =
patrick@24
   629
   block.head?,
Patrick@288
   630
   (media.image | audio | video)+,
patrick@109
   631
   media.caption?,
patrick@36
   632
   link?
patrick@0
   633
patrick@2
   634
# ~~~~~~ image
Patrick@288
   635
image = element image { image.attributes }
Patrick@288
   636
media.image = element image { image.attributes, media.image.content }
patrick@0
   637
patrick@0
   638
image.attributes =
patrick@104
   639
   media.id.attribute
Patrick@312
   640
 & image.type.attribute?
Coraline@407
   641
 & image.zoom.attribute?
Patrick@312
   642
 & alt.attribute?
patrick@17
   643
media.id.attribute = attribute id { xsd:NMTOKEN }
Patrick@312
   644
image.type.attribute = attribute type {
Patrick@312
   645
   "cover" | "thumbnail" | "icon" | "animation" }
Coraline@407
   646
image.zoom.attribute = attribute zoom {"true" | "false"}
Patrick@312
   647
alt.attribute = attribute alt { text }
patrick@0
   648
Patrick@288
   649
media.image.content =
patrick@111
   650
   copyright?,
Patrick@176
   651
   hotspot*
patrick@0
   652
patrick@45
   653
# ~~~~~~ audio
patrick@45
   654
audio = element audio { audio.attributes }
patrick@43
   655
patrick@45
   656
audio.attributes =
patrick@43
   657
   media.id.attribute
patrick@104
   658
 & audio.type?
Coraline@409
   659
audio.type = attribute type { "music" | "voice" | "en" | "fr" | "background"
Coraline@409
   660
 | "smil" }
patrick@43
   661
patrick@119
   662
# ~~~~~~ video
patrick@119
   663
video = element video { video.attributes }
patrick@119
   664
patrick@119
   665
video.attributes =
patrick@119
   666
   media.id.attribute
patrick@119
   667
Coraline@433
   668
# ~~~~~~ media.caption
Coraline@433
   669
media.caption = element caption { caption.attributes, caption.content }
Coraline@433
   670
Coraline@433
   671
caption.attributes =
Coraline@433
   672
   x.attribute?
Coraline@433
   673
 & y.attribute?
Coraline@433
   674
patrick@122
   675
# ~~~~~~ hotspot
patrick@122
   676
hotspot = element hotspot { hotspot.attributes, hotspot.content }
patrick@122
   677
patrick@122
   678
hotspot.attributes =
patrick@122
   679
   x.attribute
patrick@122
   680
 & y.attribute
patrick@182
   681
 & w.attribute
Patrick@183
   682
 & h.attribute?
Patrick@236
   683
 & hotspot.display.attribute?
Patrick@237
   684
 & hotspot.type.attribute?
Patrick@191
   685
 & xmlid.attribute?
Patrick@173
   686
x.attribute = attribute x { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
Patrick@173
   687
y.attribute = attribute y { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
patrick@182
   688
w.attribute = attribute w { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
patrick@182
   689
h.attribute = attribute h { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
Patrick@236
   690
hotspot.display.attribute = attribute display { "normal" | "visible" | "pulse" }
Patrick@237
   691
hotspot.type.attribute = attribute type { xsd:NCName }
Patrick@310
   692
Patrick@191
   693
hotspot.content =
Patrick@288
   694
   ((link | p+ | image | audio | video), (spot, scenario?)?)
Patrick@191
   695
 | (spot, scenario?)
Patrick@310
   696
 | empty
Patrick@310
   697
Patrick@191
   698
# ~~~~~~ spot
Patrick@191
   699
spot = element spot { spot.attributes, spot.content }
Patrick@191
   700
Patrick@191
   701
spot.attributes =
Patrick@191
   702
   dx.attribute?
Patrick@191
   703
 & dy.attribute?
Patrick@191
   704
 & dw.attribute?
Patrick@191
   705
 & dh.attribute?
patrick@188
   706
dx.attribute = attribute dx { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
patrick@188
   707
dy.attribute = attribute dy { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
Patrick@191
   708
dw.attribute = attribute dw { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
Patrick@191
   709
dh.attribute = attribute dh { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
Patrick@191
   710
Patrick@191
   711
spot.content =
Patrick@191
   712
   ((p+ | image), audio?)
Patrick@191
   713
 | audio
Patrick@191
   714
 | video
Patrick@191
   715
Patrick@191
   716
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scenario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@191
   717
Patrick@191
   718
# ~~~~~~ scenario
Patrick@191
   719
scenario = element scenario { scenario.content }
Patrick@191
   720
Patrick@191
   721
scenario.content =
Patrick@191
   722
   init*,
Patrick@191
   723
   onclick*
Patrick@191
   724
Patrick@191
   725
# ~~~~~~ init
Patrick@191
   726
init = element init { init.attributes }
Patrick@191
   727
Patrick@191
   728
init.attributes =
Patrick@191
   729
   init.action.attribute
Patrick@191
   730
 & target.attribute?
Patrick@191
   731
init.action.attribute = attribute action { "hide" }
Patrick@191
   732
target.attribute = attribute target { "hotspot" | "spot" }
Patrick@191
   733
Patrick@191
   734
# ~~~~~~ onclick
Patrick@191
   735
onclick = element onclick { onclick.attributes }
Patrick@191
   736
Patrick@191
   737
onclick.attributes =
Patrick@191
   738
   onclick.action.attribute
Patrick@191
   739
 & target.attribute?
Patrick@191
   740
onclick.action.attribute = attribute action { "show" }
Patrick@191
   741
Patrick@397
   742
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@189
   743
Patrick@189
   744
# ~~~~~~ bibliography.entry
Patrick@189
   745
bibliography.entry = element entry { bibliography.entry.content }
Patrick@189
   746
Patrick@189
   747
bibliography.entry.content =
Patrick@189
   748
   identifier.ean?
Patrick@189
   749
 & title
Patrick@189
   750
 & subtitle?
Patrick@189
   751
 & copyright?
Patrick@189
   752
 & collection?
Patrick@189
   753
 & contributors?
Patrick@189
   754
 & date?
Patrick@189
   755
 & place?
Patrick@189
   756
 & folio?
Patrick@189
   757
 & pages?
Patrick@189
   758
Patrick@189
   759
# ~~~~~~ folio
Patrick@189
   760
folio = element folio { folio.content }
Patrick@189
   761
Patrick@189
   762
folio.content = xsd:positiveInteger | xsd:token {pattern = "[DLXVI]+"}
Patrick@189
   763
Patrick@189
   764
# ~~~~~~ pages
Patrick@189
   765
pages = element pages { pages.content }
Patrick@189
   766
Patrick@189
   767
pages.content = xsd:positiveInteger
Patrick@189
   768
Coraline@419
   769
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ meanings ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@419
   770
Coraline@419
   771
# ~~~~~~ meanings
Coraline@419
   772
meanings = element meanings { meanings.attributes, meanings.content }
Coraline@419
   773
Coraline@419
   774
meanings.attributes =
Coraline@419
   775
   gramcode.attribute?
Coraline@419
   776
gramcode.attribute = attribute gramcode { xsd:NMTOKEN }
Coraline@419
   777
Coraline@419
   778
meanings.content =
Coraline@419
   779
   meaning+
Coraline@419
   780
Coraline@419
   781
# ~~~~~~ meaning
Coraline@419
   782
meaning = element meaning { meaning.attributes, meaning.content }
Coraline@419
   783
Coraline@419
   784
meaning.attributes =
Coraline@419
   785
   meaning.domain.attribute?
Coraline@419
   786
 & langlevel.attribute?
Coraline@419
   787
meaning.domain.attribute = attribute domain { xsd:NMTOKEN }
Coraline@419
   788
langlevel.attribute = attribute langlevel { xsd:NMTOKEN }
Coraline@419
   789
Coraline@419
   790
meaning.content =
Coraline@419
   791
   ((definition, example*, synonym*, antonym*, translation*)
Coraline@419
   792
    | (definition?, example*, synonym*, antonym*, translation+)
Coraline@419
   793
    | (definition?, example*, synonym+, antonym*, translation*)
Coraline@419
   794
    | (definition?, example*, synonym*, antonym+, translation*)),
Coraline@419
   795
   dictum*
Coraline@419
   796
Coraline@419
   797
# ~~~~~~ definition
Coraline@419
   798
definition = element definition { inlines }
Coraline@419
   799
Coraline@419
   800
# ~~~~~~ synonym, antonym
Coraline@419
   801
synonym = element synonym { simple.inlines }
Coraline@419
   802
antonym = element antonym { simple.inlines }
Coraline@419
   803
Coraline@419
   804
# ~~~~~~ translation
Coraline@419
   805
translation = element translation { simple.inlines }
Coraline@419
   806
Coraline@419
   807
# ~~~~~~ dictum
Coraline@423
   808
dictum = element dictum { dictum.content }
Coraline@423
   809
dictum.content =  p+
Coraline@419
   810
Coraline@419
   811
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ seealso ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@419
   812
Coraline@419
   813
seealso = element seealso { seealso.attributes }
Coraline@419
   814
Coraline@419
   815
seealso.attributes =
Coraline@419
   816
   gloss.ref.attribute
Coraline@419
   817
patrick@0
   818
patrick@0
   819
# =============================================================================
patrick@20
   820
#                                 INLINE LEVEL
patrick@0
   821
# =============================================================================
patrick@0
   822
patrick@0
   823
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   824
Patrick@288
   825
simple.inlines = mixed {
patrick@0
   826
   sup*
patrick@0
   827
 & sub*
patrick@42
   828
 & var*
patrick@13
   829
 & number*
Patrick@212
   830
 & acronym*
Patrick@288
   831
 & warning*
Patrick@288
   832
}
Patrick@288
   833
Patrick@293
   834
inlines = mixed {
Patrick@293
   835
   sup*
Patrick@293
   836
 & sub*
Patrick@293
   837
 & var*
Patrick@293
   838
 & number*
Patrick@293
   839
 & acronym*
Patrick@293
   840
 & warning*
Patrick@293
   841
Patrick@212
   842
 & highlight*
Patrick@238
   843
 & emphasis*
Patrick@212
   844
 & mentioned*
Patrick@350
   845
 & literal*
Patrick@350
   846
 & term*
Coraline@419
   847
 & example*
Patrick@288
   848
 & stage*
Patrick@350
   849
 & name*
Patrick@350
   850
 & foreign*
Patrick@350
   851
 & date*
Patrick@350
   852
 & math*
Patrick@351
   853
 & quote*
Patrick@212
   854
 & initial*
Patrick@288
   855
 & note*
Patrick@288
   856
 & link*
Patrick@288
   857
 & anchor*
Patrick@288
   858
 & index*
Coraline@419
   859
 & gloss*
Patrick@351
   860
 & image*
Patrick@351
   861
 & audio*
Patrick@351
   862
 & smil*
Patrick@446
   863
Coraline@436
   864
 & nowrap*
Patrick@293
   865
}
patrick@0
   866
patrick@42
   867
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   868
patrick@252
   869
sup = element sup { mixed { var* & warning* } }
patrick@0
   870
patrick@252
   871
sub = element sub { mixed { var* & warning* } }
patrick@42
   872
Patrick@225
   873
var = element var { mixed { warning* } }
patrick@42
   874
patrick@90
   875
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   876
patrick@90
   877
number = element number {
patrick@90
   878
   ( attribute type {"roman"}, number.attributes, number.roman.content )
patrick@90
   879
 | ( number.attributes, number.content)
patrick@90
   880
}
patrick@90
   881
patrick@90
   882
number.attributes =
patrick@90
   883
   number.value.attribute?
patrick@90
   884
number.value.attribute = attribute value { xsd:integer | xsd:decimal }
patrick@90
   885
Patrick@212
   886
number.content = mixed { sup* & warning* }
patrick@246
   887
number.roman.content = xsd:token {pattern = "[MCLXVI]+"}
patrick@90
   888
Patrick@350
   889
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ acronym ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@350
   890
Patrick@350
   891
acronym = element acronym { acronym.content }
Patrick@350
   892
Patrick@350
   893
acronym.content = mixed { sup* & warning* }
Patrick@350
   894
Patrick@350
   895
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ highlight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@350
   896
Patrick@350
   897
highlight = element highlight { highlight.content }
Patrick@350
   898
Patrick@350
   899
highlight.content = inlines
Patrick@350
   900
Patrick@350
   901
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ emphasis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@350
   902
Patrick@350
   903
emphasis = element emphasis { emphasis.content }
Patrick@350
   904
Patrick@350
   905
emphasis.content = inlines
Patrick@350
   906
Patrick@350
   907
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mentioned ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@350
   908
Patrick@350
   909
mentioned = element mentioned { mentioned.content }
Patrick@350
   910
Patrick@350
   911
mentioned.content = inlines
Patrick@350
   912
Patrick@350
   913
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ literal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@350
   914
Patrick@350
   915
literal = element literal { literal.content }
Patrick@350
   916
Patrick@350
   917
literal.content = inlines
Patrick@350
   918
Patrick@350
   919
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ term ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@350
   920
Patrick@350
   921
term = element term { term.content }
Patrick@350
   922
Patrick@350
   923
term.content = mixed { sup* & warning* }
Patrick@350
   924
Coraline@419
   925
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ example ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@419
   926
Coraline@419
   927
example = element example { example.content }
Patrick@446
   928
Coraline@419
   929
example.content = inlines
Coraline@419
   930
Patrick@350
   931
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ stage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@350
   932
Patrick@350
   933
stage = element stage { stage.content }
Patrick@350
   934
Patrick@350
   935
stage.content = inlines
Patrick@350
   936
Patrick@350
   937
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@350
   938
Patrick@350
   939
name = element name { name.attributes, name.content }
Patrick@350
   940
Patrick@350
   941
name.attributes =
Patrick@350
   942
   name.of.attribute?
Patrick@350
   943
name.of.attribute = attribute of {
Patrick@350
   944
   "person" | "company" | "book" | "newspaper" | "party" | "movie"
Patrick@350
   945
 | "painting" }
Patrick@350
   946
Patrick@350
   947
name.content = mixed { sup* & number* & acronym* & warning* }
Patrick@350
   948
Patrick@350
   949
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@350
   950
Patrick@350
   951
foreign = element foreign { foreign.attributes, foreign.content }
Patrick@350
   952
Patrick@350
   953
foreign.attributes =
Patrick@350
   954
   lang.attribute?
Patrick@350
   955
Patrick@350
   956
foreign.content = inlines
Patrick@350
   957
Patrick@350
   958
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@350
   959
Patrick@350
   960
date = element date { date.attributes, date.content }
Patrick@350
   961
Patrick@350
   962
date.attributes =
Patrick@350
   963
   date.value.attribute
Patrick@350
   964
 & date.of.attribute?
Patrick@350
   965
date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear }
Patrick@350
   966
date.of.attribute = attribute of { "birth" | "death" }
Patrick@350
   967
Patrick@350
   968
date.content = mixed { sup* & number* & warning* }
Patrick@350
   969
patrick@42
   970
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ math ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@42
   971
Patrick@274
   972
# ~~~~~~ math
Patrick@274
   973
math = element math { math.attributes, math.content }
patrick@42
   974
patrick@42
   975
math.attributes =
Patrick@280
   976
   xmlid.attribute?
Patrick@280
   977
 & math.display.attribute?
Patrick@435
   978
 & math.type.attribute?
Patrick@274
   979
math.display.attribute = attribute display {
Patrick@272
   980
   "wide" | "numbered" | "box"  | "numbered-box" }
Patrick@435
   981
math.type.attribute = attribute type { xsd:NCName }
patrick@42
   982
Patrick@274
   983
math.content =
Patrick@274
   984
   mixed { sup* & sub* & var* & warning* }
iinov@460
   985
 | (preambule?, latex)
Patrick@274
   986
Patrick@274
   987
# ~~~~~~ latex
Patrick@274
   988
latex = element latex { latex.attributes, latex.content }
Patrick@274
   989
Patrick@274
   990
latex.attributes =
Patrick@274
   991
   plain.attritute?
Patrick@274
   992
plain.attritute = attribute plain { xsd:boolean }
Patrick@274
   993
Patrick@274
   994
latex.content = text
patrick@0
   995
iinov@460
   996
# ~~~~~~ preambule
iinov@460
   997
preambule = element preambule { preambule.content }
iinov@460
   998
iinov@460
   999
preambule.content =
iinov@460
  1000
    newcommand+
iinov@460
  1001
iinov@460
  1002
# ~~~~~~ newcommand
iinov@460
  1003
newcommand = element newcommand { newcommand.attributes, newcommand.content }
iinov@460
  1004
iinov@460
  1005
newcommand.attributes =
iinov@460
  1006
    newcommand.name.attribute
iinov@460
  1007
newcommand.name.attribute = attribute name { xsd:NMTOKEN }
iinov@460
  1008
iinov@460
  1009
newcommand.content = text
iinov@460
  1010
patrick@36
  1011
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@5
  1012
patrick@5
  1013
quote = element quote { quote.content }
patrick@5
  1014
patrick@131
  1015
quote.content =
patrick@131
  1016
   (phrase, attribution) | inlines
patrick@131
  1017
patrick@131
  1018
phrase = element phrase { phrase.content }
patrick@131
  1019
patrick@131
  1020
phrase.content = inlines
patrick@5
  1021
Patrick@351
  1022
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ initial ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@105
  1023
Patrick@351
  1024
initial = element initial { initial.content }
patrick@105
  1025
Patrick@351
  1026
initial.content =
Patrick@351
  1027
   initial.c,
Patrick@351
  1028
   initial.w?
patrick@105
  1029
Patrick@351
  1030
initial.c = element c { text }
Patrick@351
  1031
initial.w = element w { inlines }
Patrick@205
  1032
Patrick@288
  1033
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@288
  1034
Patrick@288
  1035
note = element note { note.attributes, note.content }
Patrick@288
  1036
Patrick@288
  1037
note.attributes =
Patrick@288
  1038
   note.label.attribute?
Patrick@288
  1039
note.label.attribute = attribute label { text }
Patrick@288
  1040
Patrick@288
  1041
note.content =
Patrick@288
  1042
   (note.w?, block+)
Patrick@288
  1043
 | inlines
Patrick@288
  1044
Patrick@288
  1045
note.w = element w { inlines }
Patrick@288
  1046
Patrick@288
  1047
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@288
  1048
Patrick@288
  1049
link = element link { link.attributes, link.content }
Patrick@288
  1050
Patrick@288
  1051
link.attributes =
Patrick@288
  1052
   (uri.attribute | idref.attribute)
Patrick@288
  1053
uri.attribute = attribute uri { xsd:anyURI }
Patrick@288
  1054
idref.attribute = attribute idref { xsd:IDREF }
Patrick@288
  1055
Patrick@288
  1056
link.content = simple.inlines
Patrick@288
  1057
Patrick@288
  1058
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@288
  1059
Patrick@288
  1060
anchor = element anchor { anchor.attributes, anchor.content }
Patrick@288
  1061
Patrick@288
  1062
anchor.attributes =
Patrick@288
  1063
   anchor.id.attribute
Patrick@288
  1064
anchor.id.attribute = attribute xml:id { xsd:ID }
Patrick@288
  1065
Patrick@288
  1066
anchor.content = simple.inlines
Patrick@288
  1067
Coraline@419
  1068
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gloss ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@419
  1069
Coraline@419
  1070
gloss = element gloss { gloss.attributes, gloss.content }
Coraline@419
  1071
Coraline@419
  1072
gloss.attributes =
Coraline@419
  1073
   gloss.ref.attribute
Coraline@419
  1074
gloss.ref.attribute = attribute ref { xsd:NCName }
Coraline@419
  1075
Coraline@419
  1076
gloss.content = simple.inlines
Coraline@419
  1077
Patrick@351
  1078
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ smil ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@351
  1079
Patrick@351
  1080
smil = element smil { smil.attributes, smil.content }
Patrick@351
  1081
Patrick@351
  1082
smil.attributes =
Patrick@351
  1083
   audio.attribute?
Patrick@351
  1084
 & begin.attribute?
Patrick@351
  1085
 & end.attribute?
Patrick@351
  1086
audio.attribute = attribute audio { xsd:anyURI }
Patrick@351
  1087
begin.attribute = attribute begin { xsd:decimal }
Patrick@351
  1088
end.attribute = attribute end { xsd:decimal }
Patrick@351
  1089
Patrick@351
  1090
smil.content = inlines
Patrick@351
  1091
Coraline@436
  1092
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ nowrap ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Coraline@436
  1093
Coraline@436
  1094
nowrap = element nowrap { nowrap.content }
Coraline@436
  1095
Coraline@436
  1096
nowrap.content = inlines
Coraline@436
  1097
Patrick@205
  1098
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@205
  1099
Patrick@285
  1100
warning = element warning { warning.attributes, warning.content }
Patrick@285
  1101
Patrick@285
  1102
warning.attributes =
Patrick@285
  1103
   warning.type.attribute?
Patrick@285
  1104
warning.type.attribute = attribute type { xsd:NCName }
Patrick@205
  1105
Patrick@231
  1106
warning.content = inlines