RelaxNG/publidoc.rnc
author Patrick PIERRE <patrick.pierre@prismallia.fr>
dim., 22 janv. 2012 09:58:59 +0100
changeset 74 ebe0ab8699fc
parent 73 0a3a8006996b
child 75 70418017787e
permissions -rw-r--r--
Ajout d'un exercice à trous avec suggestions réutilisables
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
patrick@66
   156
role.content = "author" | "illustrator" | "publisher"
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@9
   327
\list = element list { \list.content }
patrick@9
   328
patrick@9
   329
\list.content =
patrick@20
   330
   block.head?,
patrick@71
   331
   (  (attribute type {"ordered"}?, item, item+)
patrick@9
   332
    | (attribute type {"glossary"}, glossary.item+) )
patrick@9
   333
patrick@9
   334
# ~~~~~~ item
patrick@9
   335
item = element item { item.content }
patrick@9
   336
patrick@30
   337
item.content =
patrick@73
   338
   inlines
patrick@73
   339
 | block+
patrick@9
   340
patrick@9
   341
# ~~~~~~ glossary.item
patrick@9
   342
glossary.item = element item { glossary.item.content }
patrick@9
   343
patrick@9
   344
glossary.item.content =
patrick@9
   345
   label,
patrick@9
   346
   block+
patrick@9
   347
patrick@44
   348
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@44
   349
patrick@44
   350
# ~~~~~~ blockquote
patrick@44
   351
blockquote = element blockquote { blockquote.content }
patrick@44
   352
patrick@44
   353
blockquote.content =
patrick@44
   354
   block.head?,
patrick@44
   355
   (p | speech | \list)+,
patrick@44
   356
   attribution?
patrick@44
   357
patrick@44
   358
# ~~~~~~ attribution
patrick@72
   359
attribution = element attribution { attribution.content }
patrick@44
   360
patrick@72
   361
attribution.content =
patrick@44
   362
   inlines
patrick@44
   363
patrick@17
   364
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@17
   365
patrick@73
   366
# ~~~~~~ table
patrick@17
   367
table = element table { table.content }
patrick@17
   368
patrick@17
   369
table.content =
patrick@20
   370
   block.head?,
patrick@17
   371
   tgroup+,
patrick@17
   372
   caption?
patrick@17
   373
patrick@17
   374
# ~~~~~~ tgroup
patrick@17
   375
tgroup = element tgroup { tgroup.attributes, tgroup.content }
patrick@17
   376
patrick@17
   377
tgroup.content =
patrick@17
   378
   thead?,
patrick@17
   379
   tfoot?,
patrick@17
   380
   tbody
patrick@17
   381
patrick@17
   382
tgroup.attributes =
patrick@17
   383
   cols.attribute
patrick@17
   384
 & align.attribute?
patrick@17
   385
 & colsep.attribute?
patrick@17
   386
 & rowsep.attribute?
patrick@17
   387
cols.attribute = attribute cols { xsd:positiveInteger }
patrick@17
   388
align.attribute = attribute align { "left"  |  "right"  | "center" | "justify" }
patrick@17
   389
colsep.attribute = attribute colsep { "0" | "1" }
patrick@17
   390
rowsep.attribute = attribute rowsep { "0" | "1" }
patrick@17
   391
patrick@17
   392
# ~~~~~~ thead, tfoot, tbody
patrick@22
   393
thead = element thead { thead.attributes, thead.content }
patrick@22
   394
tfoot = element tfoot { tfoot.attributes, tfoot.content }
patrick@22
   395
tbody = element tbody { tbody.attributes, tbody.content }
patrick@17
   396
patrick@22
   397
thead.attributes =
patrick@22
   398
   valign.attribute?
patrick@22
   399
tfoot.attributes =
patrick@22
   400
   valign.attribute?
patrick@22
   401
tbody.attributes =
patrick@22
   402
   valign.attribute?
patrick@22
   403
valign.attribute = attribute valign { "top" | "middle" | "bottom" }
patrick@22
   404
   
patrick@17
   405
thead.content =
patrick@17
   406
   row+
patrick@17
   407
tfoot.content =
patrick@17
   408
   row+
patrick@17
   409
tbody.content =
patrick@17
   410
   row+
patrick@17
   411
patrick@17
   412
# ~~~~~~ row
patrick@17
   413
row = element row { row.attribute, row.content }
patrick@17
   414
patrick@17
   415
row.attribute =
patrick@17
   416
   valign.attribute?
patrick@17
   417
patrick@17
   418
row.content =
patrick@17
   419
  entry+
patrick@17
   420
patrick@17
   421
# ~~~~~~ entry
patrick@17
   422
entry = element entry { entry.content }
patrick@17
   423
patrick@17
   424
entry.content =
patrick@17
   425
   inlines
patrick@37
   426
 | (p | media)+
patrick@17
   427
patrick@17
   428
# ~~~~~~ caption
patrick@17
   429
caption = element caption { caption.content }
patrick@17
   430
patrick@17
   431
caption.content =
patrick@20
   432
   inlines
patrick@20
   433
 | p+
patrick@17
   434
patrick@35
   435
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   436
patrick@2
   437
# ~~~~~~ media
patrick@0
   438
media = element media { media.content }
patrick@0
   439
patrick@0
   440
media.content =
patrick@24
   441
   block.head?,
patrick@45
   442
   (image | audio)+,
patrick@35
   443
   caption?,
patrick@36
   444
   link?
patrick@0
   445
patrick@2
   446
# ~~~~~~ image
patrick@0
   447
image = element image { image.attributes, image.content }
patrick@0
   448
patrick@0
   449
image.attributes =
patrick@49
   450
   media.id.attribute,
patrick@49
   451
   image.type?
patrick@17
   452
media.id.attribute = attribute id { xsd:NMTOKEN }
patrick@50
   453
image.type = attribute type { "cover" | "thumbnail" }
patrick@0
   454
patrick@0
   455
image.content =
patrick@0
   456
   copyright?
patrick@0
   457
patrick@45
   458
# ~~~~~~ audio
patrick@45
   459
audio = element audio { audio.attributes }
patrick@43
   460
patrick@45
   461
audio.attributes =
patrick@43
   462
   media.id.attribute
patrick@43
   463
patrick@0
   464
patrick@0
   465
# =============================================================================
patrick@20
   466
#                                 INLINE LEVEL
patrick@0
   467
# =============================================================================
patrick@0
   468
patrick@0
   469
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   470
patrick@0
   471
inlines = mixed {
patrick@0
   472
   sup*
patrick@0
   473
 & sub*
patrick@42
   474
 & var*
patrick@13
   475
 & number*
patrick@42
   476
 & math*
patrick@0
   477
 & date*
patrick@0
   478
 & name*
patrick@5
   479
 & note*
patrick@0
   480
 & foreign*
patrick@0
   481
 & highlight*
patrick@5
   482
 & mentioned*
patrick@5
   483
 & quote*
patrick@8
   484
 & acronym*
patrick@8
   485
 & term*
patrick@25
   486
 & link*
patrick@42
   487
 & anchor*
patrick@0
   488
}
patrick@0
   489
patrick@42
   490
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   491
patrick@42
   492
sup = element sup { text }
patrick@0
   493
patrick@42
   494
sub = element sub { text }
patrick@42
   495
patrick@42
   496
var = element var { text }
patrick@42
   497
patrick@42
   498
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ math ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@42
   499
patrick@42
   500
math = element math {
patrick@42
   501
   ( attribute notation {"tex"}, math.attributes, math.tex.content )
patrick@42
   502
 | ( math.attributes, math.content)
patrick@42
   503
}
patrick@42
   504
patrick@42
   505
math.attributes =
patrick@42
   506
   wide.attribute?
patrick@42
   507
wide.attribute = attribute wide { xsd:boolean }
patrick@42
   508
patrick@42
   509
math.content = mixed { sup* & sub* & var* }
patrick@42
   510
math.tex.content = text
patrick@0
   511
patrick@13
   512
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   513
patrick@13
   514
number = element number {
patrick@13
   515
   ( attribute type {"roman"}, number.attributes, number.roman.content )
patrick@13
   516
 | ( number.attributes, number.content)
patrick@13
   517
}
patrick@13
   518
patrick@13
   519
number.attributes =
patrick@13
   520
   number.value.attribute?
patrick@13
   521
number.value.attribute = attribute value { xsd:integer | xsd:decimal }
patrick@13
   522
patrick@13
   523
number.content = mixed { sup* }
patrick@13
   524
number.roman.content = xsd:token {pattern = "[dlxvi]+"}
patrick@0
   525
patrick@36
   526
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   527
patrick@0
   528
date = element date { date.attributes, date.content }
patrick@0
   529
patrick@3
   530
date.attributes =
patrick@13
   531
   date.value.attribute
patrick@13
   532
 & date.of.attribute?
patrick@13
   533
date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear }
patrick@33
   534
date.of.attribute = attribute of { "birth" | "death" }
patrick@0
   535
patrick@13
   536
date.content = mixed { sup* }
patrick@0
   537
patrick@36
   538
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   539
patrick@0
   540
name = element name { name.attributes, name.content }
patrick@2
   541
patrick@2
   542
name.attributes =
patrick@2
   543
   name.of.attribute?
patrick@33
   544
name.of.attribute = attribute of
patrick@33
   545
   { "person" | "company" | "book" | "newspaper" | "party" }
patrick@0
   546
patrick@2
   547
name.content = inlines
patrick@2
   548
patrick@36
   549
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   550
patrick@5
   551
note = element note { note.attributes, note.content }
patrick@0
   552
patrick@5
   553
note.attributes =
patrick@5
   554
   note.label.attribute?
patrick@5
   555
note.label.attribute = attribute label { text }
patrick@0
   556
patrick@5
   557
note.content =
patrick@17
   558
   inlines
patrick@20
   559
 | p+
patrick@0
   560
patrick@36
   561
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   562
patrick@0
   563
foreign = element foreign { foreign.attributes, foreign.content }
patrick@0
   564
patrick@9
   565
foreign.attributes =
patrick@9
   566
   lang.attribute?
patrick@0
   567
patrick@0
   568
foreign.content = inlines
patrick@0
   569
patrick@36
   570
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ highlight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   571
patrick@0
   572
highlight = element highlight { highlight.content }
patrick@0
   573
patrick@0
   574
highlight.content = inlines
patrick@0
   575
patrick@36
   576
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mentioned ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@5
   577
patrick@5
   578
mentioned = element mentioned { mentioned.content }
patrick@5
   579
patrick@5
   580
mentioned.content = inlines
patrick@5
   581
patrick@36
   582
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@5
   583
patrick@5
   584
quote = element quote { quote.content }
patrick@5
   585
patrick@5
   586
quote.content = inlines
patrick@5
   587
patrick@36
   588
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ acronym ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@8
   589
patrick@8
   590
acronym = element acronym { acronym.content }
patrick@8
   591
patrick@8
   592
acronym.content = inlines
patrick@8
   593
patrick@36
   594
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ term ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@8
   595
patrick@8
   596
term = element term { term.content }
patrick@8
   597
patrick@8
   598
term.content = inlines
patrick@8
   599
patrick@36
   600
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@0
   601
patrick@0
   602
link = element link { link.attributes, link.content }
patrick@0
   603
patrick@9
   604
link.attributes =
patrick@42
   605
   (uri.attribute | idref.attribute)
patrick@9
   606
uri.attribute = attribute uri { xsd:anyURI }
patrick@9
   607
idref.attribute = attribute idref { xsd:IDREF }
patrick@0
   608
patrick@0
   609
link.content = inlines
patrick@42
   610
patrick@42
   611
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
patrick@42
   612
patrick@43
   613
anchor = element anchor { anchor.attributes }
patrick@42
   614
patrick@42
   615
anchor.attributes =
patrick@42
   616
   anchor.id.attribute
patrick@42
   617
anchor.id.attribute = attribute xml:id { xsd:ID }