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