RelaxNG/publidoc.rnc
author Patrick PIERRE
lun., 08 avril 2013 13:27:02 +0200
changeset 190 546609a92447
parent 189 951f1a25efc5
child 191 e50ac13ec921
permissions -rw-r--r--
topic pure bibliography
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
patrick@0
    18
patrick@0
    19
patrick@0
    20
# =============================================================================
patrick@20
    21
#                                  TOP LEVEL
patrick@0
    22
# =============================================================================
patrick@0
    23
patrick@98
    24
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
    25
patrick@90
    26
top.head = element head { top.head.content }
patrick@90
    27
patrick@90
    28
top.head.content =
patrick@127
    29
   (title, shorttitle?, subtitle?)?
patrick@156
    30
 & (identifier, identifier?)?
patrick@181
    31
 & copyright*
Patrick@155
    32
 & collection?
patrick@90
    33
 & contributors?
patrick@90
    34
 & date?
patrick@90
    35
 & place?
patrick@156
    36
 & (source, source?)?
patrick@90
    37
 & keywordset?
patrick@90
    38
 & subjectset?
patrick@90
    39
 & abstract?
patrick@90
    40
 & cover?
patrick@90
    41
 & annotation*
patrick@90
    42
patrick@0
    43
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
    44
patrick@90
    45
# ~~~~~~ document
patrick@0
    46
document = element document { document.attributes, document.content }
patrick@0
    47
patrick@0
    48
document.attributes =
patrick@0
    49
   document.id.attribute
patrick@142
    50
 & document.type.attribute?
patrick@66
    51
 & lang.attribute?
patrick@117
    52
document.id.attribute = attribute id { xsd:NMTOKEN }
patrick@142
    53
document.type.attribute = attribute type { xsd:NCName }
patrick@66
    54
lang.attribute = attribute xml:lang { xsd:language }
patrick@0
    55
patrick@0
    56
document.content =
patrick@20
    57
   top.head?,
patrick@56
    58
   (division | topic)+
patrick@0
    59
patrick@0
    60
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
    61
patrick@18
    62
top.topic = element topic { top.topic.attributes, top.topic.content }
patrick@0
    63
patrick@20
    64
top.topic.attributes =
patrick@20
    65
   topic.id.attribute
patrick@20
    66
 & topic.type.attribute?
patrick@66
    67
 & lang.attribute?
patrick@117
    68
topic.id.attribute = attribute id { xsd:NMTOKEN }
patrick@20
    69
topic.type.attribute = attribute type { xsd:NCName }
patrick@20
    70
patrick@20
    71
top.topic.content =
patrick@20
    72
   top.head?,
Patrick@137
    73
   header?,
Patrick@190
    74
   ((section+, bibliography?) | bibliography),
Patrick@137
    75
   footer?
patrick@0
    76
patrick@40
    77
patrick@0
    78
# =============================================================================
patrick@20
    79
#                                 DIVISION LEVEL
patrick@0
    80
# =============================================================================
patrick@0
    81
patrick@70
    82
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
    83
patrick@90
    84
# ~~~~~~ division
patrick@0
    85
division = element division { division.content }
patrick@0
    86
patrick@0
    87
division.content =
patrick@20
    88
   division.head?,
patrick@56
    89
   (division | topic)+
patrick@0
    90
patrick@90
    91
# ~~~~~~ division.head
patrick@90
    92
division.head = element head { division.head.content }
patrick@90
    93
patrick@90
    94
division.head.content =
patrick@127
    95
   (title, shorttitle?, subtitle?)?
patrick@90
    96
 & abstract?
patrick@90
    97
 & annotation*
patrick@90
    98
patrick@0
    99
patrick@0
   100
# =============================================================================
patrick@90
   101
#                                COMPONENT LEVEL
patrick@0
   102
# =============================================================================
patrick@0
   103
patrick@90
   104
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ component.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   105
patrick@90
   106
component.head = element head { component.head.content }
patrick@90
   107
patrick@90
   108
component.head.content =
patrick@127
   109
   (title, shorttitle?, subtitle?)?
patrick@90
   110
 & contributors?
patrick@143
   111
 & date?
patrick@143
   112
 & place?
patrick@143
   113
 & keywordset?
patrick@143
   114
 & subjectset?
patrick@90
   115
 & abstract?
patrick@90
   116
 & annotation*
patrick@90
   117
patrick@0
   118
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   119
patrick@0
   120
topic = element topic { topic.attributes, topic.content }
patrick@0
   121
patrick@0
   122
topic.attributes =
patrick@122
   123
   (topic.id.attribute | topic.xmlid.attribute)?
patrick@0
   124
 & topic.type.attribute?
patrick@69
   125
 & lang.attribute?
patrick@122
   126
topic.xmlid.attribute = attribute xml:id { xsd:ID }
patrick@0
   127
patrick@0
   128
topic.content =
patrick@20
   129
   component.head?,
Patrick@137
   130
   header?,
Patrick@190
   131
   ((section+, bibliography?) | bibliography),
Patrick@137
   132
   footer?
patrick@0
   133
patrick@0
   134
patrick@0
   135
# =============================================================================
patrick@20
   136
#                                 SECTION LEVEL
patrick@0
   137
# =============================================================================
patrick@0
   138
Patrick@137
   139
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@137
   140
Patrick@137
   141
header = element header { header.content }
Patrick@137
   142
Patrick@137
   143
header.content =
Patrick@137
   144
   block+
Patrick@137
   145
patrick@20
   146
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   147
patrick@90
   148
# ~~~~~~ section
patrick@58
   149
section = element section { section.attributes, section.content }
patrick@58
   150
patrick@58
   151
section.attributes =
patrick@58
   152
   section.type.attribute?
patrick@64
   153
 & lang.attribute?
patrick@166
   154
 & for.attribute?
patrick@58
   155
section.type.attribute = attribute type { xsd:NCName }
patrick@166
   156
for.attribute = attribute for { xsd:NCName }
patrick@0
   157
patrick@0
   158
section.content =
patrick@20
   159
   section.head?,
patrick@9
   160
   (section+ | block+)
patrick@0
   161
patrick@90
   162
# ~~~~~~ section.head
patrick@90
   163
section.head = element head { section.head.content }
patrick@90
   164
patrick@90
   165
section.head.content =
patrick@127
   166
   (title, shorttitle?, subtitle?)?
Marc@177
   167
 & keywordset?
Marc@177
   168
 & subjectset?
patrick@90
   169
 & abstract?
patrick@105
   170
 & audio*
patrick@90
   171
 & annotation*
patrick@90
   172
Patrick@189
   173
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@189
   174
Patrick@189
   175
# ~~~~~~ bibliography
Patrick@189
   176
bibliography = element bibliography { bibliography.content }
Patrick@189
   177
Patrick@189
   178
bibliography.content =
Patrick@189
   179
   bibliography.entry+
Patrick@189
   180
Patrick@137
   181
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@137
   182
Patrick@137
   183
footer = element footer { footer.content }
Patrick@137
   184
Patrick@137
   185
footer.content =
Patrick@137
   186
   block+
Patrick@137
   187
patrick@0
   188
patrick@0
   189
# =============================================================================
patrick@20
   190
#                                 BLOCK LEVEL
patrick@0
   191
# =============================================================================
patrick@0
   192
patrick@20
   193
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@9
   194
patrick@90
   195
# ~~~~~~ block
patrick@44
   196
block = (p | speech | \list | blockquote | table | media)
patrick@9
   197
patrick@90
   198
# ~~~~~~ block.head
patrick@90
   199
block.head = element head { block.head.content }
patrick@90
   200
patrick@90
   201
block.head.content =
patrick@127
   202
   (title, shorttitle?, subtitle?)?
patrick@90
   203
patrick@42
   204
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   205
patrick@20
   206
p = element p { p.content }
patrick@0
   207
patrick@20
   208
p.content =
patrick@0
   209
   inlines
patrick@0
   210
patrick@18
   211
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@18
   212
patrick@18
   213
# ~~~~~~ speech
patrick@18
   214
speech = element speech { speech.content }
patrick@18
   215
patrick@18
   216
speech.content =
patrick@18
   217
   speaker?,
patrick@18
   218
   stage?,
patrick@20
   219
   p+
patrick@18
   220
patrick@18
   221
# ~~~~~~ speaker
patrick@18
   222
speaker = element speaker { speaker.content }
patrick@18
   223
patrick@18
   224
speaker.content = inlines
patrick@18
   225
patrick@17
   226
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@9
   227
patrick@9
   228
# ~~~~~~ list
patrick@75
   229
\list = element list {
patrick@20
   230
   block.head?,
patrick@71
   231
   (  (attribute type {"ordered"}?, item, item+)
patrick@9
   232
    | (attribute type {"glossary"}, glossary.item+) )
patrick@75
   233
}
patrick@9
   234
patrick@9
   235
# ~~~~~~ item
patrick@9
   236
item = element item { item.content }
patrick@9
   237
patrick@30
   238
item.content =
patrick@73
   239
   inlines
patrick@73
   240
 | block+
patrick@9
   241
patrick@9
   242
# ~~~~~~ glossary.item
patrick@9
   243
glossary.item = element item { glossary.item.content }
patrick@9
   244
patrick@9
   245
glossary.item.content =
patrick@9
   246
   label,
patrick@9
   247
   block+
patrick@9
   248
patrick@44
   249
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@44
   250
patrick@44
   251
# ~~~~~~ blockquote
patrick@44
   252
blockquote = element blockquote { blockquote.content }
patrick@44
   253
patrick@44
   254
blockquote.content =
patrick@44
   255
   block.head?,
patrick@44
   256
   (p | speech | \list)+,
patrick@44
   257
   attribution?
patrick@44
   258
patrick@44
   259
# ~~~~~~ attribution
patrick@72
   260
attribution = element attribution { attribution.content }
patrick@44
   261
patrick@72
   262
attribution.content =
patrick@44
   263
   inlines
patrick@44
   264
patrick@17
   265
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@17
   266
patrick@73
   267
# ~~~~~~ table
patrick@17
   268
table = element table { table.content }
patrick@17
   269
patrick@17
   270
table.content =
patrick@20
   271
   block.head?,
patrick@17
   272
   tgroup+,
patrick@109
   273
   table.caption?
patrick@17
   274
patrick@17
   275
# ~~~~~~ tgroup
patrick@17
   276
tgroup = element tgroup { tgroup.attributes, tgroup.content }
patrick@17
   277
patrick@17
   278
tgroup.content =
patrick@17
   279
   thead?,
patrick@17
   280
   tbody
patrick@17
   281
patrick@17
   282
tgroup.attributes =
patrick@17
   283
   cols.attribute
patrick@17
   284
 & align.attribute?
patrick@17
   285
 & colsep.attribute?
patrick@17
   286
 & rowsep.attribute?
patrick@17
   287
cols.attribute = attribute cols { xsd:positiveInteger }
patrick@17
   288
align.attribute = attribute align { "left"  |  "right"  | "center" | "justify" }
patrick@17
   289
colsep.attribute = attribute colsep { "0" | "1" }
patrick@17
   290
rowsep.attribute = attribute rowsep { "0" | "1" }
patrick@17
   291
patrick@146
   292
# ~~~~~~ thead, tbody
patrick@22
   293
thead = element thead { thead.attributes, thead.content }
patrick@22
   294
tbody = element tbody { tbody.attributes, tbody.content }
patrick@17
   295
patrick@22
   296
thead.attributes =
patrick@22
   297
   valign.attribute?
patrick@22
   298
tbody.attributes =
patrick@22
   299
   valign.attribute?
patrick@22
   300
valign.attribute = attribute valign { "top" | "middle" | "bottom" }
patrick@75
   301
patrick@17
   302
thead.content =
patrick@17
   303
   row+
patrick@17
   304
tbody.content =
patrick@17
   305
   row+
patrick@17
   306
patrick@17
   307
# ~~~~~~ row
patrick@146
   308
row = element row { row.attributes, row.content }
patrick@17
   309
patrick@146
   310
row.attributes =
patrick@17
   311
   valign.attribute?
patrick@146
   312
 & rowsep.attribute?
patrick@17
   313
patrick@17
   314
row.content =
Patrick@189
   315
  table.entry+
patrick@17
   316
Patrick@189
   317
# ~~~~~~ table.entry
Patrick@189
   318
table.entry = element entry { table.entry.attributes, table.entry.content }
patrick@146
   319
Patrick@189
   320
table.entry.attributes =
patrick@146
   321
   align.attribute?
patrick@146
   322
 & valign.attribute?
patrick@146
   323
 & colsep.attribute?
patrick@146
   324
 & rowsep.attribute?
patrick@17
   325
Patrick@189
   326
table.entry.content =
patrick@17
   327
   inlines
patrick@37
   328
 | (p | media)+
patrick@17
   329
patrick@109
   330
# ~~~~~~ table.caption
patrick@109
   331
table.caption = element caption { caption.content }
patrick@17
   332
patrick@17
   333
caption.content =
patrick@20
   334
   inlines
Patrick@138
   335
 | (p | speech | \list | blockquote)+
patrick@17
   336
patrick@35
   337
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   338
patrick@2
   339
# ~~~~~~ media
patrick@0
   340
media = element media { media.content }
patrick@0
   341
patrick@0
   342
media.content =
patrick@24
   343
   block.head?,
patrick@119
   344
   (image | audio | video)+,
patrick@109
   345
   media.caption?,
patrick@36
   346
   link?
patrick@0
   347
patrick@2
   348
# ~~~~~~ image
patrick@0
   349
image = element image { image.attributes, image.content }
patrick@0
   350
patrick@0
   351
image.attributes =
patrick@104
   352
   media.id.attribute
patrick@104
   353
 & image.type?
patrick@17
   354
media.id.attribute = attribute id { xsd:NMTOKEN }
Patrick@184
   355
image.type = attribute type { "cover" | "thumbnail" | "icon" | "animation" }
patrick@0
   356
patrick@0
   357
image.content =
patrick@111
   358
   copyright?,
Patrick@176
   359
   hotspot*
patrick@0
   360
patrick@45
   361
# ~~~~~~ audio
patrick@45
   362
audio = element audio { audio.attributes }
patrick@43
   363
patrick@45
   364
audio.attributes =
patrick@43
   365
   media.id.attribute
patrick@104
   366
 & audio.type?
patrick@113
   367
audio.type = attribute type { "music" | "voice" | "background" | "smil" }
patrick@43
   368
patrick@119
   369
# ~~~~~~ video
patrick@119
   370
video = element video { video.attributes }
patrick@119
   371
patrick@119
   372
video.attributes =
patrick@119
   373
   media.id.attribute
patrick@119
   374
patrick@122
   375
# ~~~~~~ hotspot
patrick@122
   376
hotspot = element hotspot { hotspot.attributes, hotspot.content }
patrick@122
   377
patrick@122
   378
hotspot.attributes =
patrick@122
   379
   x.attribute
patrick@122
   380
 & y.attribute
patrick@182
   381
 & w.attribute
Patrick@183
   382
 & h.attribute?
Patrick@183
   383
 & (hotspot.type.attribute
Patrick@183
   384
  & dx.attribute?
Patrick@183
   385
  & dy.attribute?
Patrick@183
   386
  & dw.attribute?
Patrick@183
   387
  & dh.attribute?)?
Patrick@173
   388
x.attribute = attribute x { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
Patrick@173
   389
y.attribute = attribute y { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
patrick@182
   390
w.attribute = attribute w { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
patrick@182
   391
h.attribute = attribute h { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
Patrick@183
   392
hotspot.type.attribute = attribute type { "normal" | "visible" | "pulse" }
patrick@188
   393
dx.attribute = attribute dx { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
patrick@188
   394
dy.attribute = attribute dy { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
patrick@188
   395
dw.attribute = attribute dw { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
patrick@188
   396
dh.attribute = attribute dh { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
Patrick@176
   397
   
patrick@122
   398
hotspot.content =
Patrick@183
   399
   (p | link | image | audio | video),
Patrick@183
   400
   scenario?
patrick@109
   401
   
patrick@109
   402
# ~~~~~~ media.caption
patrick@109
   403
media.caption = element caption { caption.attributes, caption.content }
patrick@109
   404
patrick@109
   405
caption.attributes =
patrick@109
   406
   x.attribute?
patrick@109
   407
 & y.attribute?
patrick@109
   408
Patrick@189
   409
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliograpgy.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@189
   410
Patrick@189
   411
# ~~~~~~ bibliography.entry
Patrick@189
   412
bibliography.entry = element entry { bibliography.entry.content }
Patrick@189
   413
Patrick@189
   414
bibliography.entry.content =
Patrick@189
   415
   identifier.ean?
Patrick@189
   416
 & title
Patrick@189
   417
 & subtitle?
Patrick@189
   418
 & copyright?
Patrick@189
   419
 & collection?
Patrick@189
   420
 & contributors?
Patrick@189
   421
 & date?
Patrick@189
   422
 & place?
Patrick@189
   423
 & folio?
Patrick@189
   424
 & pages?
Patrick@189
   425
Patrick@189
   426
# ~~~~~~ folio
Patrick@189
   427
folio = element folio { folio.content }
Patrick@189
   428
Patrick@189
   429
folio.content = xsd:positiveInteger | xsd:token {pattern = "[DLXVI]+"}
Patrick@189
   430
Patrick@189
   431
# ~~~~~~ pages
Patrick@189
   432
pages = element pages { pages.content }
Patrick@189
   433
Patrick@189
   434
pages.content = xsd:positiveInteger
Patrick@189
   435
Patrick@183
   436
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scenario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@183
   437
Patrick@183
   438
# ~~~~~~ scenario
Patrick@183
   439
scenario = element scenario { scenario.content }
Patrick@183
   440
Patrick@183
   441
scenario.content =
Patrick@183
   442
   init*,
Patrick@183
   443
   onclick*
Patrick@183
   444
Patrick@183
   445
# ~~~~~~ init
Patrick@183
   446
init = element init { init.attributes }
Patrick@183
   447
Patrick@183
   448
init.attributes =
Patrick@183
   449
   init.action.attribute
Patrick@183
   450
init.action.attribute = attribute action { "hide" }
Patrick@183
   451
Patrick@183
   452
# ~~~~~~ onclick
Patrick@183
   453
onclick = element onclick { onclick.attributes }
Patrick@183
   454
Patrick@183
   455
onclick.attributes =
Patrick@183
   456
   onclick.action.attribute
Patrick@183
   457
onclick.action.attribute = attribute action { "show" }
Patrick@183
   458
patrick@0
   459
patrick@0
   460
# =============================================================================
patrick@90
   461
#                                 HEAD LEVEL
patrick@90
   462
# =============================================================================
patrick@90
   463
patrick@127
   464
# ~~~~~~~~~~~~~~~~~~~~~~~ title, shorttitle, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   465
patrick@90
   466
title = element title { title.content }
patrick@127
   467
shorttitle = element shorttitle { title.content }
patrick@90
   468
subtitle = element subtitle { title.content }
patrick@90
   469
patrick@90
   470
title.content = inlines
patrick@90
   471
patrick@90
   472
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   473
patrick@156
   474
identifier = element identifier {
patrick@156
   475
   (attribute type { "ean" }, xsd:token {pattern = "\d{13}"})
patrick@156
   476
 | (attribute type { "uri" }, xsd:anyURI)
patrick@90
   477
}
patrick@90
   478
patrick@90
   479
identifier.ean = element identifier {
patrick@90
   480
   attribute type { "ean" }, xsd:token {pattern = "\d{13}"}
patrick@90
   481
}
patrick@90
   482
patrick@156
   483
identifier.uri = element identifier {
patrick@156
   484
   attribute type { "uri" }, xsd:anyURI
patrick@156
   485
}
patrick@90
   486
patrick@90
   487
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   488
patrick@90
   489
copyright = element copyright { copyright.content }
patrick@90
   490
patrick@90
   491
copyright.content = inlines
patrick@90
   492
Patrick@155
   493
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ collection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@155
   494
Patrick@155
   495
collection = element collection { collection.content }
Patrick@155
   496
Patrick@155
   497
collection.content = inlines
Patrick@155
   498
patrick@90
   499
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ contributors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   500
patrick@90
   501
# ~~~~~~ contributors
patrick@90
   502
contributors = element contributors { contributors.content }
patrick@90
   503
patrick@90
   504
contributors.content =
patrick@90
   505
   contributor+
patrick@90
   506
patrick@90
   507
# ~~~~~~ contributor
patrick@90
   508
contributor = element contributor { contributor.content }
patrick@90
   509
patrick@90
   510
contributor.content =
patrick@90
   511
   (((firstname, secondname?)?, lastname) | label),
patrick@90
   512
   address?,
patrick@90
   513
   link?,
patrick@101
   514
   role+
patrick@90
   515
patrick@90
   516
# ~~~~~~ firstname, secondname, lastname, label
patrick@90
   517
firstname = element firstname { firstname.content }
patrick@90
   518
secondname = element secondname { secondname.content }
patrick@90
   519
lastname = element lastname { lastname.content }
patrick@90
   520
label = element label { label.content }
patrick@90
   521
patrick@90
   522
firstname.content = inlines
patrick@90
   523
secondname.content = inlines
patrick@90
   524
lastname.content = inlines
patrick@90
   525
label.content = inlines
patrick@90
   526
patrick@90
   527
# ~~~~~~ address
patrick@90
   528
address = element address { address.content }
patrick@90
   529
patrick@90
   530
address.content = inlines
patrick@90
   531
patrick@90
   532
# ~~~~~~ role
patrick@90
   533
role = element role { role.content }
patrick@90
   534
patrick@90
   535
role.content = "author" | "illustrator" | "publisher" | "packager"
patrick@90
   536
patrick@90
   537
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   538
patrick@90
   539
place = element place { place.content }
patrick@90
   540
patrick@90
   541
place.content = inlines
patrick@90
   542
patrick@90
   543
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   544
patrick@90
   545
source = element source {
Patrick@189
   546
   (  (attribute type { "book" }, bibliography.entry.content)
patrick@90
   547
    | (attribute type { "file" }, source.content.file)),
patrick@90
   548
   source.content
patrick@90
   549
}
patrick@90
   550
patrick@90
   551
source.content.file =
patrick@90
   552
   identifier.uri
patrick@90
   553
source.content =
patrick@90
   554
   annotation*
patrick@90
   555
Patrick@189
   556
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   557
patrick@90
   558
# ~~~~~~ keywordset
patrick@90
   559
keywordset = element keywordset { keywordset.content }
patrick@90
   560
patrick@90
   561
keywordset.content = keyword+
patrick@90
   562
patrick@90
   563
# ~~~~~~ keyword
patrick@90
   564
keyword = element keyword { keyword.content }
patrick@90
   565
patrick@90
   566
keyword.content = mixed { sup*, sub* }
patrick@90
   567
patrick@90
   568
# ~~~~~~ subjectset
patrick@90
   569
subjectset = element subjectset { subjectset.content }
patrick@90
   570
patrick@90
   571
subjectset.content = subject+
patrick@90
   572
patrick@90
   573
# ~~~~~~ subject
patrick@132
   574
subject = element subject { subject.content }
patrick@90
   575
patrick@132
   576
subject.content = xsd:NMTOKEN
patrick@90
   577
patrick@90
   578
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   579
patrick@90
   580
abstract = element abstract { abstract.content }
patrick@90
   581
patrick@90
   582
abstract.content =
patrick@90
   583
   p+
patrick@90
   584
patrick@90
   585
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   586
patrick@90
   587
cover = element cover { cover.content }
patrick@90
   588
patrick@90
   589
cover.content =
patrick@90
   590
   cover.image
patrick@90
   591
patrick@90
   592
cover.image = element image { cover.image.attributes }
patrick@90
   593
patrick@90
   594
cover.image.attributes =
patrick@90
   595
   cover.image.id.attribute
patrick@90
   596
cover.image.id.attribute = attribute id { xsd:NMTOKEN }
patrick@105
   597
   
patrick@90
   598
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   599
patrick@90
   600
annotation = element annotation { annotation.content }
patrick@90
   601
patrick@90
   602
annotation.content = inlines
patrick@90
   603
patrick@90
   604
patrick@90
   605
# =============================================================================
patrick@20
   606
#                                 INLINE LEVEL
patrick@0
   607
# =============================================================================
patrick@0
   608
patrick@0
   609
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   610
patrick@0
   611
inlines = mixed {
patrick@0
   612
   sup*
patrick@0
   613
 & sub*
patrick@42
   614
 & var*
patrick@13
   615
 & number*
patrick@42
   616
 & math*
patrick@0
   617
 & date*
patrick@0
   618
 & name*
patrick@5
   619
 & note*
patrick@0
   620
 & foreign*
patrick@0
   621
 & highlight*
patrick@5
   622
 & quote*
patrick@8
   623
 & acronym*
Patrick@140
   624
 & mentioned*
patrick@8
   625
 & term*
Patrick@185
   626
 & stage*
Patrick@140
   627
 & literal*
Patrick@185
   628
 & initial*
patrick@25
   629
 & link*
patrick@42
   630
 & anchor*
patrick@93
   631
 & image*
patrick@105
   632
 & smil*
patrick@0
   633
}
patrick@0
   634
patrick@42
   635
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   636
patrick@42
   637
sup = element sup { text }
patrick@0
   638
patrick@42
   639
sub = element sub { text }
patrick@42
   640
patrick@42
   641
var = element var { text }
patrick@42
   642
patrick@90
   643
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@90
   644
patrick@90
   645
number = element number {
patrick@90
   646
   ( attribute type {"roman"}, number.attributes, number.roman.content )
patrick@90
   647
 | ( number.attributes, number.content)
patrick@90
   648
}
patrick@90
   649
patrick@90
   650
number.attributes =
patrick@90
   651
   number.value.attribute?
patrick@90
   652
number.value.attribute = attribute value { xsd:integer | xsd:decimal }
patrick@90
   653
patrick@90
   654
number.content = mixed { sup* }
patrick@157
   655
number.roman.content = xsd:token {pattern = "[DLXVI]+"}
patrick@90
   656
patrick@42
   657
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ math ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@42
   658
patrick@42
   659
math = element math {
patrick@42
   660
   ( attribute notation {"tex"}, math.attributes, math.tex.content )
patrick@42
   661
 | ( math.attributes, math.content)
patrick@42
   662
}
patrick@42
   663
patrick@42
   664
math.attributes =
patrick@42
   665
   wide.attribute?
patrick@42
   666
wide.attribute = attribute wide { xsd:boolean }
patrick@42
   667
patrick@42
   668
math.content = mixed { sup* & sub* & var* }
patrick@42
   669
math.tex.content = text
patrick@0
   670
patrick@36
   671
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   672
patrick@0
   673
date = element date { date.attributes, date.content }
patrick@0
   674
patrick@3
   675
date.attributes =
patrick@13
   676
   date.value.attribute
patrick@13
   677
 & date.of.attribute?
patrick@13
   678
date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear }
patrick@33
   679
date.of.attribute = attribute of { "birth" | "death" }
patrick@0
   680
patrick@13
   681
date.content = mixed { sup* }
patrick@0
   682
patrick@36
   683
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   684
patrick@0
   685
name = element name { name.attributes, name.content }
patrick@2
   686
patrick@2
   687
name.attributes =
patrick@2
   688
   name.of.attribute?
patrick@33
   689
name.of.attribute = attribute of
Patrick@135
   690
   { "person" | "company" | "book" | "newspaper" | "party" | "painting" }
patrick@0
   691
patrick@2
   692
name.content = inlines
patrick@2
   693
patrick@36
   694
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   695
patrick@5
   696
note = element note { note.attributes, note.content }
patrick@0
   697
patrick@5
   698
note.attributes =
patrick@5
   699
   note.label.attribute?
patrick@5
   700
note.label.attribute = attribute label { text }
patrick@0
   701
patrick@5
   702
note.content =
claire@180
   703
   (w?, block+) | inlines
patrick@91
   704
patrick@91
   705
w = element w { inlines }
patrick@0
   706
patrick@36
   707
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   708
patrick@0
   709
foreign = element foreign { foreign.attributes, foreign.content }
patrick@0
   710
patrick@9
   711
foreign.attributes =
patrick@9
   712
   lang.attribute?
patrick@0
   713
patrick@0
   714
foreign.content = inlines
patrick@0
   715
patrick@36
   716
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ highlight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   717
patrick@0
   718
highlight = element highlight { highlight.content }
patrick@0
   719
patrick@0
   720
highlight.content = inlines
patrick@0
   721
patrick@36
   722
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@5
   723
patrick@5
   724
quote = element quote { quote.content }
patrick@5
   725
patrick@131
   726
quote.content =
patrick@131
   727
   (phrase, attribution) | inlines
patrick@131
   728
patrick@131
   729
phrase = element phrase { phrase.content }
patrick@131
   730
patrick@131
   731
phrase.content = inlines
patrick@5
   732
patrick@36
   733
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ acronym ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@8
   734
patrick@8
   735
acronym = element acronym { acronym.content }
patrick@8
   736
patrick@8
   737
acronym.content = inlines
patrick@8
   738
Patrick@140
   739
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mentioned ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@140
   740
Patrick@140
   741
mentioned = element mentioned { mentioned.content }
Patrick@140
   742
Patrick@140
   743
mentioned.content = inlines
Patrick@140
   744
patrick@36
   745
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ term ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@8
   746
patrick@8
   747
term = element term { term.content }
patrick@8
   748
patrick@8
   749
term.content = inlines
patrick@8
   750
Patrick@185
   751
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ stage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@185
   752
Patrick@185
   753
stage = element stage { stage.content }
Patrick@185
   754
Patrick@185
   755
stage.content = inlines
Patrick@185
   756
Patrick@140
   757
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ literal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@140
   758
Patrick@140
   759
literal = element literal { literal.content }
Patrick@140
   760
Patrick@140
   761
literal.content = text
Patrick@140
   762
Patrick@185
   763
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ initial ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick@185
   764
Patrick@185
   765
initial = element initial { initial.content }
Patrick@185
   766
Patrick@185
   767
initial.content =
Patrick@185
   768
   c,
Patrick@185
   769
   w?
Patrick@185
   770
Patrick@185
   771
c = element c { text }
Patrick@185
   772
patrick@36
   773
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   774
patrick@0
   775
link = element link { link.attributes, link.content }
patrick@0
   776
patrick@9
   777
link.attributes =
patrick@42
   778
   (uri.attribute | idref.attribute)
patrick@9
   779
uri.attribute = attribute uri { xsd:anyURI }
patrick@9
   780
idref.attribute = attribute idref { xsd:IDREF }
patrick@0
   781
patrick@0
   782
link.content = inlines
patrick@42
   783
patrick@42
   784
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@42
   785
Patrick@147
   786
anchor = element anchor { anchor.attributes, anchor.content }
patrick@42
   787
patrick@42
   788
anchor.attributes =
patrick@42
   789
   anchor.id.attribute
patrick@42
   790
anchor.id.attribute = attribute xml:id { xsd:ID }
patrick@91
   791
Patrick@147
   792
anchor.content = inlines
Patrick@147
   793
patrick@105
   794
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ smil ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@105
   795
patrick@105
   796
smil = element smil { smil.attributes, smil.content }
patrick@105
   797
patrick@105
   798
smil.attributes =
patrick@105
   799
   begin.attribute?
patrick@105
   800
 & end.attribute?
patrick@105
   801
begin.attribute = attribute begin { xsd:decimal }
patrick@105
   802
end.attribute = attribute end { xsd:decimal }
patrick@105
   803
patrick@105
   804
smil.content = inlines