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