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