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