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