RelaxNG/publidoc.rnc
author Yvon BOURBOTTE <yvon.bourbotte@prismallia.fr>
mer., 01 févr. 2012 18:19:33 +0100
changeset 86 2d51a1795ed3
parent 75 70418017787e
child 90 d5067911c762
permissions -rw-r--r--
ajout de contributor role packager
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@0
    24
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
    25
patrick@0
    26
document = element document { document.attributes, document.content }
patrick@0
    27
patrick@0
    28
document.attributes =
patrick@0
    29
   document.id.attribute
patrick@66
    30
 & lang.attribute?
patrick@0
    31
document.id.attribute = attribute xml:id { xsd:ID }
patrick@66
    32
lang.attribute = attribute xml:lang { xsd:language }
patrick@0
    33
patrick@0
    34
document.content =
patrick@20
    35
   top.head?,
patrick@56
    36
   (division | topic)+
patrick@0
    37
patrick@0
    38
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
    39
patrick@18
    40
top.topic = element topic { top.topic.attributes, top.topic.content }
patrick@0
    41
patrick@20
    42
top.topic.attributes =
patrick@20
    43
   topic.id.attribute
patrick@20
    44
 & topic.type.attribute?
patrick@66
    45
 & lang.attribute?
patrick@20
    46
topic.id.attribute = attribute xml:id { xsd:ID }
patrick@20
    47
topic.type.attribute = attribute type { xsd:NCName }
patrick@20
    48
patrick@20
    49
top.topic.content =
patrick@20
    50
   top.head?,
patrick@20
    51
   section+
patrick@0
    52
patrick@40
    53
patrick@0
    54
# =============================================================================
patrick@20
    55
#                                 HEAD LEVEL
patrick@0
    56
# =============================================================================
patrick@0
    57
patrick@20
    58
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
    59
patrick@20
    60
top.head = element head { top.head.content }
patrick@20
    61
division.head = element head { division.head.content }
patrick@20
    62
component.head = element head { component.head.content }
patrick@20
    63
section.head = element head { section.head.content }
patrick@20
    64
block.head = element head { block.head.content }
patrick@0
    65
patrick@20
    66
top.head.content =
patrick@18
    67
   (title, subtitle?)?
patrick@34
    68
 & identifier*
patrick@39
    69
 & copyright?
patrick@66
    70
 & contributors?
patrick@0
    71
 & date?
patrick@0
    72
 & place?
patrick@0
    73
 & source*
patrick@40
    74
 & keywordset?
patrick@0
    75
 & subjectset?
patrick@0
    76
 & abstract?
patrick@35
    77
 & cover?
patrick@0
    78
 & annotation*
patrick@20
    79
division.head.content =
patrick@18
    80
   (title, subtitle?)?
patrick@63
    81
 & abstract?
patrick@18
    82
 & annotation*
patrick@20
    83
component.head.content =
patrick@18
    84
   (title, subtitle?)?
patrick@66
    85
 & contributors?
patrick@41
    86
 & abstract?
patrick@18
    87
 & annotation*
patrick@20
    88
section.head.content =
patrick@18
    89
   (title, subtitle?)?
patrick@41
    90
 & abstract?
patrick@18
    91
 & annotation*
patrick@20
    92
block.head.content =
patrick@20
    93
   (title, subtitle?)?
patrick@0
    94
patrick@0
    95
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
    96
patrick@0
    97
title = element title { title.content }
patrick@18
    98
subtitle = element subtitle { title.content }
patrick@2
    99
patrick@0
   100
title.content = inlines
patrick@0
   101
patrick@34
   102
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@34
   103
patrick@38
   104
identifier.uri = element identifier {
patrick@38
   105
   attribute type { "uri" }, xsd:anyURI
patrick@38
   106
}
patrick@34
   107
patrick@38
   108
identifier.ean = element identifier {
patrick@38
   109
   attribute type { "ean" }, xsd:token {pattern = "\d{13}"}
patrick@38
   110
}
patrick@34
   111
patrick@38
   112
identifier = identifier.uri | identifier.ean
patrick@34
   113
patrick@39
   114
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@39
   115
patrick@39
   116
copyright = element copyright { copyright.content }
patrick@39
   117
patrick@39
   118
copyright.content = inlines
patrick@39
   119
patrick@66
   120
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ contributors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   121
patrick@66
   122
# ~~~~~~ contributors
patrick@66
   123
contributors = element contributors { contributors.content }
patrick@0
   124
patrick@66
   125
contributors.content =
patrick@66
   126
   contributor+
patrick@66
   127
patrick@66
   128
# ~~~~~~ contributor
patrick@66
   129
contributor = element contributor { contributor.content }
patrick@66
   130
patrick@66
   131
contributor.content =
patrick@66
   132
   (((firstname, secondname?)?, lastname) | label),
patrick@66
   133
   address?,
patrick@66
   134
   link?,
patrick@33
   135
   role*
patrick@33
   136
patrick@66
   137
# ~~~~~~ firstname, secondname, lastname, label
patrick@5
   138
firstname = element firstname { firstname.content }
patrick@66
   139
secondname = element secondname { secondname.content }
patrick@66
   140
lastname = element lastname { lastname.content }
patrick@66
   141
label = element label { label.content }
patrick@5
   142
patrick@5
   143
firstname.content = inlines
patrick@66
   144
secondname.content = inlines
patrick@66
   145
lastname.content = inlines
patrick@66
   146
label.content = inlines
patrick@5
   147
patrick@66
   148
# ~~~~~~ address
patrick@66
   149
address = element address { address.content }
patrick@5
   150
patrick@66
   151
address.content = inlines
patrick@5
   152
patrick@34
   153
# ~~~~~~ role
patrick@66
   154
role = element role { role.content }
patrick@34
   155
yvon@86
   156
role.content = "author" | "illustrator" | "publisher" | "packager"
patrick@38
   157
patrick@2
   158
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@2
   159
patrick@2
   160
place = element place { place.content }
patrick@2
   161
patrick@2
   162
place.content = inlines
patrick@2
   163
patrick@0
   164
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   165
patrick@2
   166
# ~~~~~~ source
patrick@0
   167
source = element source {
patrick@0
   168
   (  (attribute type { "book" }, source.content.book)
patrick@38
   169
    | (attribute type { "file" }, source.content.file)),
patrick@0
   170
   source.content
patrick@0
   171
}
patrick@0
   172
patrick@0
   173
source.content.book =
patrick@38
   174
   identifier.ean,
patrick@38
   175
   title?,
patrick@0
   176
   pagenumber*
patrick@38
   177
source.content.file =
patrick@38
   178
   identifier.uri
patrick@0
   179
source.content =
patrick@0
   180
   annotation*
patrick@0
   181
patrick@2
   182
# ~~~~~~ pagenumber
patrick@0
   183
pagenumber = element pagenumber { pagenumber.attributes }
patrick@2
   184
patrick@0
   185
pagenumber.attributes =
patrick@0
   186
   pagenumber.value.attribute
patrick@33
   187
pagenumber.value.attribute = attribute value { xsd:positiveInteger }
patrick@0
   188
patrick@40
   189
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@40
   190
patrick@40
   191
# ~~~~~~ keywordset
patrick@40
   192
keywordset = element keywordset { keywordset.content }
patrick@40
   193
patrick@40
   194
keywordset.content = keyword+
patrick@40
   195
patrick@40
   196
# ~~~~~~ keyword
patrick@40
   197
keyword = element keyword { keyword.content }
patrick@40
   198
patrick@53
   199
keyword.content = mixed { sup*, sub* }
patrick@0
   200
patrick@2
   201
# ~~~~~~ subjectset
patrick@0
   202
subjectset = element subjectset { subjectset.content }
patrick@0
   203
patrick@0
   204
subjectset.content = subject+
patrick@0
   205
patrick@2
   206
# ~~~~~~ subject
patrick@0
   207
subject = element subject { subject.attributes }
patrick@2
   208
patrick@0
   209
subject.attributes =
patrick@0
   210
   subject.id.attribute
patrick@0
   211
subject.id.attribute = attribute id { xsd:NMTOKEN }
patrick@0
   212
patrick@5
   213
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@2
   214
patrick@2
   215
abstract = element abstract { abstract.content }
patrick@2
   216
patrick@2
   217
abstract.content =
patrick@20
   218
   p+
patrick@2
   219
patrick@35
   220
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@35
   221
patrick@35
   222
cover = element cover { cover.content }
patrick@35
   223
patrick@35
   224
cover.content =
patrick@35
   225
   cover.image
patrick@35
   226
patrick@35
   227
cover.image = element image { cover.image.attributes }
patrick@35
   228
patrick@35
   229
cover.image.attributes =
patrick@35
   230
   cover.image.id.attribute
patrick@35
   231
cover.image.id.attribute = attribute id { xsd:NMTOKEN }
patrick@35
   232
patrick@0
   233
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   234
patrick@0
   235
annotation = element annotation { annotation.content }
patrick@0
   236
patrick@0
   237
annotation.content = inlines
patrick@0
   238
patrick@0
   239
patrick@0
   240
# =============================================================================
patrick@20
   241
#                                 DIVISION LEVEL
patrick@0
   242
# =============================================================================
patrick@0
   243
patrick@70
   244
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   245
patrick@0
   246
division = element division { division.content }
patrick@0
   247
patrick@0
   248
division.content =
patrick@20
   249
   division.head?,
patrick@56
   250
   (division | topic)+
patrick@0
   251
patrick@0
   252
patrick@0
   253
# =============================================================================
patrick@20
   254
#                               COMPONENT LEVEL
patrick@0
   255
# =============================================================================
patrick@0
   256
patrick@0
   257
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   258
patrick@0
   259
topic = element topic { topic.attributes, topic.content }
patrick@0
   260
patrick@0
   261
topic.attributes =
patrick@0
   262
   topic.id.attribute?
patrick@0
   263
 & topic.type.attribute?
patrick@69
   264
 & lang.attribute?
patrick@0
   265
patrick@0
   266
topic.content =
patrick@20
   267
   component.head?,
patrick@0
   268
   section+
patrick@0
   269
patrick@0
   270
patrick@0
   271
# =============================================================================
patrick@20
   272
#                                 SECTION LEVEL
patrick@0
   273
# =============================================================================
patrick@0
   274
patrick@20
   275
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   276
patrick@58
   277
section = element section { section.attributes, section.content }
patrick@58
   278
patrick@58
   279
section.attributes =
patrick@58
   280
   section.type.attribute?
patrick@64
   281
 & lang.attribute?
patrick@58
   282
section.type.attribute = attribute type { xsd:NCName }
patrick@0
   283
patrick@0
   284
section.content =
patrick@20
   285
   section.head?,
patrick@9
   286
   (section+ | block+)
patrick@0
   287
patrick@0
   288
patrick@0
   289
# =============================================================================
patrick@20
   290
#                                 BLOCK LEVEL
patrick@0
   291
# =============================================================================
patrick@0
   292
patrick@20
   293
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@9
   294
patrick@44
   295
block = (p | speech | \list | blockquote | table | media)
patrick@9
   296
patrick@42
   297
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   298
patrick@20
   299
p = element p { p.content }
patrick@0
   300
patrick@20
   301
p.content =
patrick@0
   302
   inlines
patrick@0
   303
patrick@18
   304
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@18
   305
patrick@18
   306
# ~~~~~~ speech
patrick@18
   307
speech = element speech { speech.content }
patrick@18
   308
patrick@18
   309
speech.content =
patrick@18
   310
   speaker?,
patrick@18
   311
   stage?,
patrick@20
   312
   p+
patrick@18
   313
patrick@18
   314
# ~~~~~~ speaker
patrick@18
   315
speaker = element speaker { speaker.content }
patrick@18
   316
patrick@18
   317
speaker.content = inlines
patrick@18
   318
patrick@18
   319
# ~~~~~~ stage
patrick@18
   320
stage = element stage { stage.content }
patrick@18
   321
patrick@18
   322
stage.content = inlines
patrick@18
   323
patrick@17
   324
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@9
   325
patrick@9
   326
# ~~~~~~ list
patrick@75
   327
\list = element list {
patrick@20
   328
   block.head?,
patrick@71
   329
   (  (attribute type {"ordered"}?, item, item+)
patrick@9
   330
    | (attribute type {"glossary"}, glossary.item+) )
patrick@75
   331
}
patrick@9
   332
patrick@9
   333
# ~~~~~~ item
patrick@9
   334
item = element item { item.content }
patrick@9
   335
patrick@30
   336
item.content =
patrick@73
   337
   inlines
patrick@73
   338
 | block+
patrick@9
   339
patrick@9
   340
# ~~~~~~ glossary.item
patrick@9
   341
glossary.item = element item { glossary.item.content }
patrick@9
   342
patrick@9
   343
glossary.item.content =
patrick@9
   344
   label,
patrick@9
   345
   block+
patrick@9
   346
patrick@44
   347
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@44
   348
patrick@44
   349
# ~~~~~~ blockquote
patrick@44
   350
blockquote = element blockquote { blockquote.content }
patrick@44
   351
patrick@44
   352
blockquote.content =
patrick@44
   353
   block.head?,
patrick@44
   354
   (p | speech | \list)+,
patrick@44
   355
   attribution?
patrick@44
   356
patrick@44
   357
# ~~~~~~ attribution
patrick@72
   358
attribution = element attribution { attribution.content }
patrick@44
   359
patrick@72
   360
attribution.content =
patrick@44
   361
   inlines
patrick@44
   362
patrick@17
   363
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@17
   364
patrick@73
   365
# ~~~~~~ table
patrick@17
   366
table = element table { table.content }
patrick@17
   367
patrick@17
   368
table.content =
patrick@20
   369
   block.head?,
patrick@17
   370
   tgroup+,
patrick@17
   371
   caption?
patrick@17
   372
patrick@17
   373
# ~~~~~~ tgroup
patrick@17
   374
tgroup = element tgroup { tgroup.attributes, tgroup.content }
patrick@17
   375
patrick@17
   376
tgroup.content =
patrick@17
   377
   thead?,
patrick@17
   378
   tfoot?,
patrick@17
   379
   tbody
patrick@17
   380
patrick@17
   381
tgroup.attributes =
patrick@17
   382
   cols.attribute
patrick@17
   383
 & align.attribute?
patrick@17
   384
 & colsep.attribute?
patrick@17
   385
 & rowsep.attribute?
patrick@17
   386
cols.attribute = attribute cols { xsd:positiveInteger }
patrick@17
   387
align.attribute = attribute align { "left"  |  "right"  | "center" | "justify" }
patrick@17
   388
colsep.attribute = attribute colsep { "0" | "1" }
patrick@17
   389
rowsep.attribute = attribute rowsep { "0" | "1" }
patrick@17
   390
patrick@17
   391
# ~~~~~~ thead, tfoot, tbody
patrick@22
   392
thead = element thead { thead.attributes, thead.content }
patrick@22
   393
tfoot = element tfoot { tfoot.attributes, tfoot.content }
patrick@22
   394
tbody = element tbody { tbody.attributes, tbody.content }
patrick@17
   395
patrick@22
   396
thead.attributes =
patrick@22
   397
   valign.attribute?
patrick@22
   398
tfoot.attributes =
patrick@22
   399
   valign.attribute?
patrick@22
   400
tbody.attributes =
patrick@22
   401
   valign.attribute?
patrick@22
   402
valign.attribute = attribute valign { "top" | "middle" | "bottom" }
patrick@75
   403
patrick@17
   404
thead.content =
patrick@17
   405
   row+
patrick@17
   406
tfoot.content =
patrick@17
   407
   row+
patrick@17
   408
tbody.content =
patrick@17
   409
   row+
patrick@17
   410
patrick@17
   411
# ~~~~~~ row
patrick@17
   412
row = element row { row.attribute, row.content }
patrick@17
   413
patrick@17
   414
row.attribute =
patrick@17
   415
   valign.attribute?
patrick@17
   416
patrick@17
   417
row.content =
patrick@17
   418
  entry+
patrick@17
   419
patrick@17
   420
# ~~~~~~ entry
patrick@17
   421
entry = element entry { entry.content }
patrick@17
   422
patrick@17
   423
entry.content =
patrick@17
   424
   inlines
patrick@37
   425
 | (p | media)+
patrick@17
   426
patrick@17
   427
# ~~~~~~ caption
patrick@17
   428
caption = element caption { caption.content }
patrick@17
   429
patrick@17
   430
caption.content =
patrick@20
   431
   inlines
patrick@20
   432
 | p+
patrick@17
   433
patrick@35
   434
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   435
patrick@2
   436
# ~~~~~~ media
patrick@0
   437
media = element media { media.content }
patrick@0
   438
patrick@0
   439
media.content =
patrick@24
   440
   block.head?,
patrick@45
   441
   (image | audio)+,
patrick@35
   442
   caption?,
patrick@36
   443
   link?
patrick@0
   444
patrick@2
   445
# ~~~~~~ image
patrick@0
   446
image = element image { image.attributes, image.content }
patrick@0
   447
patrick@0
   448
image.attributes =
patrick@49
   449
   media.id.attribute,
patrick@49
   450
   image.type?
patrick@17
   451
media.id.attribute = attribute id { xsd:NMTOKEN }
patrick@50
   452
image.type = attribute type { "cover" | "thumbnail" }
patrick@0
   453
patrick@0
   454
image.content =
patrick@0
   455
   copyright?
patrick@0
   456
patrick@45
   457
# ~~~~~~ audio
patrick@45
   458
audio = element audio { audio.attributes }
patrick@43
   459
patrick@45
   460
audio.attributes =
patrick@43
   461
   media.id.attribute
patrick@43
   462
patrick@0
   463
patrick@0
   464
# =============================================================================
patrick@20
   465
#                                 INLINE LEVEL
patrick@0
   466
# =============================================================================
patrick@0
   467
patrick@0
   468
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   469
patrick@0
   470
inlines = mixed {
patrick@0
   471
   sup*
patrick@0
   472
 & sub*
patrick@42
   473
 & var*
patrick@13
   474
 & number*
patrick@42
   475
 & math*
patrick@0
   476
 & date*
patrick@0
   477
 & name*
patrick@5
   478
 & note*
patrick@0
   479
 & foreign*
patrick@0
   480
 & highlight*
patrick@5
   481
 & mentioned*
patrick@5
   482
 & quote*
patrick@8
   483
 & acronym*
patrick@8
   484
 & term*
patrick@25
   485
 & link*
patrick@42
   486
 & anchor*
patrick@0
   487
}
patrick@0
   488
patrick@42
   489
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   490
patrick@42
   491
sup = element sup { text }
patrick@0
   492
patrick@42
   493
sub = element sub { text }
patrick@42
   494
patrick@42
   495
var = element var { text }
patrick@42
   496
patrick@42
   497
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ math ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@42
   498
patrick@42
   499
math = element math {
patrick@42
   500
   ( attribute notation {"tex"}, math.attributes, math.tex.content )
patrick@42
   501
 | ( math.attributes, math.content)
patrick@42
   502
}
patrick@42
   503
patrick@42
   504
math.attributes =
patrick@42
   505
   wide.attribute?
patrick@42
   506
wide.attribute = attribute wide { xsd:boolean }
patrick@42
   507
patrick@42
   508
math.content = mixed { sup* & sub* & var* }
patrick@42
   509
math.tex.content = text
patrick@0
   510
patrick@13
   511
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   512
patrick@13
   513
number = element number {
patrick@13
   514
   ( attribute type {"roman"}, number.attributes, number.roman.content )
patrick@13
   515
 | ( number.attributes, number.content)
patrick@13
   516
}
patrick@13
   517
patrick@13
   518
number.attributes =
patrick@13
   519
   number.value.attribute?
patrick@13
   520
number.value.attribute = attribute value { xsd:integer | xsd:decimal }
patrick@13
   521
patrick@13
   522
number.content = mixed { sup* }
patrick@13
   523
number.roman.content = xsd:token {pattern = "[dlxvi]+"}
patrick@0
   524
patrick@36
   525
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   526
patrick@0
   527
date = element date { date.attributes, date.content }
patrick@0
   528
patrick@3
   529
date.attributes =
patrick@13
   530
   date.value.attribute
patrick@13
   531
 & date.of.attribute?
patrick@13
   532
date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear }
patrick@33
   533
date.of.attribute = attribute of { "birth" | "death" }
patrick@0
   534
patrick@13
   535
date.content = mixed { sup* }
patrick@0
   536
patrick@36
   537
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   538
patrick@0
   539
name = element name { name.attributes, name.content }
patrick@2
   540
patrick@2
   541
name.attributes =
patrick@2
   542
   name.of.attribute?
patrick@33
   543
name.of.attribute = attribute of
patrick@33
   544
   { "person" | "company" | "book" | "newspaper" | "party" }
patrick@0
   545
patrick@2
   546
name.content = inlines
patrick@2
   547
patrick@36
   548
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   549
patrick@5
   550
note = element note { note.attributes, note.content }
patrick@0
   551
patrick@5
   552
note.attributes =
patrick@5
   553
   note.label.attribute?
patrick@5
   554
note.label.attribute = attribute label { text }
patrick@0
   555
patrick@5
   556
note.content =
patrick@17
   557
   inlines
patrick@20
   558
 | p+
patrick@0
   559
patrick@36
   560
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   561
patrick@0
   562
foreign = element foreign { foreign.attributes, foreign.content }
patrick@0
   563
patrick@9
   564
foreign.attributes =
patrick@9
   565
   lang.attribute?
patrick@0
   566
patrick@0
   567
foreign.content = inlines
patrick@0
   568
patrick@36
   569
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ highlight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   570
patrick@0
   571
highlight = element highlight { highlight.content }
patrick@0
   572
patrick@0
   573
highlight.content = inlines
patrick@0
   574
patrick@36
   575
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mentioned ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@5
   576
patrick@5
   577
mentioned = element mentioned { mentioned.content }
patrick@5
   578
patrick@5
   579
mentioned.content = inlines
patrick@5
   580
patrick@36
   581
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@5
   582
patrick@5
   583
quote = element quote { quote.content }
patrick@5
   584
patrick@5
   585
quote.content = inlines
patrick@5
   586
patrick@36
   587
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ acronym ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@8
   588
patrick@8
   589
acronym = element acronym { acronym.content }
patrick@8
   590
patrick@8
   591
acronym.content = inlines
patrick@8
   592
patrick@36
   593
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ term ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@8
   594
patrick@8
   595
term = element term { term.content }
patrick@8
   596
patrick@8
   597
term.content = inlines
patrick@8
   598
patrick@36
   599
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   600
patrick@0
   601
link = element link { link.attributes, link.content }
patrick@0
   602
patrick@9
   603
link.attributes =
patrick@42
   604
   (uri.attribute | idref.attribute)
patrick@9
   605
uri.attribute = attribute uri { xsd:anyURI }
patrick@9
   606
idref.attribute = attribute idref { xsd:IDREF }
patrick@0
   607
patrick@0
   608
link.content = inlines
patrick@42
   609
patrick@42
   610
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@42
   611
patrick@43
   612
anchor = element anchor { anchor.attributes }
patrick@42
   613
patrick@42
   614
anchor.attributes =
patrick@42
   615
   anchor.id.attribute
patrick@42
   616
anchor.id.attribute = attribute xml:id { xsd:ID }