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