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