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