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