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