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