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