RelaxNG/publidoc.rnc
changeset 476 6c30a3543cd8
parent 460 7e0c719c9526
child 481 bb1c88842f0c
equal deleted inserted replaced
475:e415b3d474a1 476:6c30a3543cd8
     1 
       
     2 start = publidoc
     1 start = publidoc
     3 
     2 
     4 publidoc = element publidoc {
     3 publidoc = element publidoc {
     5    publidoc.attributes,
     4                publidoc.attributes,
     6    publidoc.content
     5                publidoc.content
     7 }
     6            }
     8 
     7 
     9 publidoc.attributes =
     8 publidoc.attributes =
    10    version.attribute
     9     version.attribute
    11 version.attribute = attribute version { "1.0" }
    10 version.attribute = attribute version { "1.0" }
    12 
    11 
    13 publidoc.content =
    12 publidoc.content =
    14    document
    13     document
    15  | top.topic
    14     | glossary
    16  | glossary
    15     | topic
    17 
    16 
    18 # =============================================================================
    17 # =============================================================================
    19 #                                 HEAD LEVEL
    18 #                                    HEAD
    20 # =============================================================================
    19 # =============================================================================
    21 
    20 
    22 # ~~~~~~~~~~~~~~~~~~~~~~~ title, shorttitle, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~
    21 # ~~~~~~~~~~~~~~~~~~~~~~~ title, shorttitle, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~
    23 
    22 
    24 title = element title { title.content }
    23 title = element title { title.content }
    28 title.content = inlines
    27 title.content = inlines
    29 
    28 
    30 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    29 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    31 
    30 
    32 # ~~~~~~ identifier
    31 # ~~~~~~ identifier
    33 identifier = element identifier {
    32 identifier =
    34    (attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"})
    33     element identifier {
    35  | (attribute type { "uri" }, for.attribute?, xsd:anyURI)
    34         (attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"}) |
    36 }
    35         (attribute type { "uri" }, for.attribute?, xsd:anyURI)
       
    36     }
    37 
    37 
    38 # ~~~~~~ identifier.ean
    38 # ~~~~~~ identifier.ean
    39 identifier.ean = element identifier {
    39 identifier.ean =
    40    attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"}
    40     element identifier {
    41 }
    41         attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"}
       
    42     }
    42 
    43 
    43 # ~~~~~~ identifier.uri
    44 # ~~~~~~ identifier.uri
    44 identifier.uri = element identifier {
    45 identifier.uri =
    45    attribute type { "uri" }, for.attribute?, xsd:anyURI
    46     element identifier { attribute type { "uri" }, for.attribute?, xsd:anyURI }
    46 }
       
    47 
    47 
    48 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    48 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    49 
    49 
    50 copyright = element copyright { copyright.content }
    50 copyright = element copyright { copyright.content }
    51 
    51 
    61 
    61 
    62 # ~~~~~~ contributors
    62 # ~~~~~~ contributors
    63 contributors = element contributors { contributors.content }
    63 contributors = element contributors { contributors.content }
    64 
    64 
    65 contributors.content =
    65 contributors.content =
    66    contributor+
    66     contributor+
    67 
    67 
    68 # ~~~~~~ contributor
    68 # ~~~~~~ contributor
    69 contributor = element contributor { contributor.content }
    69 contributor = element contributor { contributor.content }
    70 
    70 
    71 contributor.content =
    71 contributor.content =
    72    identifier.uri?,
    72     identifier.uri?,
    73    ((firstname?, lastname) | label),
    73     ((firstname?, lastname) | label),
    74    address?,
    74     address?,
    75    link?,
    75     link?,
    76    role+
    76     role+
    77 
    77 
    78 # ~~~~~~ firstname, secondname, lastname, label
    78 # ~~~~~~ firstname, secondname, lastname, label
    79 firstname = element firstname { firstname.content }
    79 firstname = element firstname { firstname.content }
    80 lastname = element lastname { lastname.content }
    80 lastname = element lastname { lastname.content }
    81 label = element label { label.content }
    81 label = element label { label.content }
    90 address.content = simple.inlines
    90 address.content = simple.inlines
    91 
    91 
    92 # ~~~~~~ role
    92 # ~~~~~~ role
    93 role = element role { role.content }
    93 role = element role { role.content }
    94 
    94 
    95 role.content = "author" | "illustrator" | "publisher" | "packager"
    95 role.content =
    96  | "translator"
    96     "author" | "illustrator" | "publisher" | "packager" | "translator"
    97 
    97 
    98 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    98 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    99 
    99 
   100 place = element place { place.content }
   100 place = element place { place.content }
   101 
   101 
   102 place.content = simple.inlines
   102 place.content = simple.inlines
   103 
   103 
   104 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   104 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   105 
   105 
   106 source = element source {
   106 source =
   107    (  (attribute type { "book" }, bibliography.entry.content)
   107     element source {
   108     | (attribute type { "file" }, source.content.file)),
   108         ( (attribute type { "book" }, bibliography.entry.content) |
   109    source.content
   109           (attribute type { "file" }, source.content.file) ),
   110 }
   110         source.content
       
   111     }
   111 
   112 
   112 source.content.file =
   113 source.content.file =
   113    identifier.uri
   114     identifier.uri
   114 source.content =
   115 source.content =
   115    annotation?
   116     annotation?
   116 
   117 
   117 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   118 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   118 
   119 
   119 # ~~~~~~ keywordset
   120 # ~~~~~~ keywordset
   120 keywordset = element keywordset { keywordset.content }
   121 keywordset = element keywordset { keywordset.content }
   146 # ~~~~~~ index
   147 # ~~~~~~ index
   147 index = element index { index.content }
   148 index = element index { index.content }
   148 head.index = element index { head.index.content }
   149 head.index = element index { head.index.content }
   149 
   150 
   150 index.content =
   151 index.content =
   151    (index.w, index.entry?)
   152     (index.w, index.entry?)
   152  | (index.entry, (index.w | index.entry)?)
   153     | (index.entry, (index.w | index.entry)?)
   153 head.index.content =
   154 head.index.content =
   154    index.entry, index.entry?
   155     index.entry, index.entry?
   155 
   156 
   156 # ~~~~~~ index.w
   157 # ~~~~~~ index.w
   157 index.w = element w { simple.inlines }
   158 index.w = element w { simple.inlines }
   158 
   159 
   159 # ~~~~~~ index.entry
   160 # ~~~~~~ index.entry
   162 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   163 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   163 
   164 
   164 abstract = element abstract { abstract.content }
   165 abstract = element abstract { abstract.content }
   165 
   166 
   166 abstract.content =
   167 abstract.content =
   167    p+
   168     p+
   168 
   169 
   169 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   170 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   170 
   171 
   171 cover = element cover { cover.content }
   172 cover = element cover { cover.content }
   172 
   173 
   173 cover.content =
   174 cover.content =
   174    cover.image
   175     cover.image
   175 
   176 
   176 cover.image = element image { cover.image.attributes }
   177 cover.image = element image { cover.image.attributes }
   177 
   178 
   178 cover.image.attributes =
   179 cover.image.attributes =
   179    media.id.attribute
   180     media.id.attribute
   180 
   181 
   181 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   182 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   182 
   183 
   183 annotation = element annotation { annotation.content }
   184 annotation = element annotation { annotation.content }
   184 
   185 
   185 annotation.content =
   186 annotation.content =
   186    inlines | p+
   187     inlines | p+
   187 
   188 
   188 
   189 
   189 # =============================================================================
   190 # =============================================================================
   190 #                                  TOP LEVEL
   191 #                                    DOCUMENT
   191 # =============================================================================
   192 # =============================================================================
   192 
   193 
   193 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   194 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   194 
   195 
   195 top.head = element head { top.head.content }
   196 document.head = element head { document.head.content }
   196 
   197 
   197 top.head.content =
   198 document.head.content =
   198    (title & shorttitle? & subtitle*)?
   199     (title & shorttitle? & subtitle*)?
   199  & identifier*
   200     & identifier*
   200  & copyright*
   201     & copyright*
   201  & collection?
   202     & collection?
   202  & contributors?
   203     & contributors?
   203  & date?
   204     & date?
   204  & place?
   205     & place?
   205  & (source, source?)?
   206     & (source, source?)?
   206  & keywordset?
   207     & keywordset?
   207  & subjectset?
   208     & subjectset?
   208  & indexset?
   209     & indexset?
   209  & abstract?
   210     & abstract?
   210  & cover?
   211     & cover?
   211  & annotation?
   212     & annotation?
   212 
   213 
   213 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   214 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   214 
   215 
   215 document = element document { document.attributes, document.content }
   216 document = element document { document.attributes, document.content }
   216 
   217 
   217 document.attributes =
   218 document.attributes =
   218    document.id.attribute?
   219     document.id.attribute?
   219  & document.type.attribute?
   220     & document.type.attribute?
   220  & lang.attribute?
   221     & lang.attribute?
   221 document.id.attribute = attribute id { xsd:NMTOKEN }
   222 document.id.attribute = attribute id { xsd:NMTOKEN }
   222 document.type.attribute = attribute type { xsd:NCName }
   223 document.type.attribute = attribute type { xsd:NCName }
   223 lang.attribute = attribute xml:lang { xsd:language }
   224 lang.attribute = attribute xml:lang { xsd:language }
   224 
   225 
   225 document.content =
   226 document.content =
   226    top.head?,
   227     document.head?,
   227    (division | topic | glossary)+
   228     (division | document.topic | glossary)+
   228 
   229 
   229 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   230 
   230 
   231 # =============================================================================
   231 top.topic = element topic { top.topic.attributes, top.topic.content }
   232 #                                   GLOSSARY
   232 
   233 # =============================================================================
   233 top.topic.attributes =
   234 
   234    topic.id.attribute?
   235 glossary = element glossary { glossary.attributes, glossary.content }
   235  & topic.type.attribute?
   236 
   236  & lang.attribute?
   237 glossary.attributes =
       
   238     glossary.type.attribute?
       
   239     & lang.attribute?
       
   240     & langto.attribute?
       
   241 glossary.type.attribute = attribute type { xsd:NCName }
       
   242 langto.attribute = attribute langto { xsd:language }
       
   243 
       
   244 glossary.content =
       
   245     glossary.entry+
       
   246 
       
   247 
       
   248 # =============================================================================
       
   249 #                                   DIVISION
       
   250 # =============================================================================
       
   251 
       
   252 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   253 
       
   254 division.head = element head { division.head.content }
       
   255 
       
   256 division.head.content =
       
   257     (title & shorttitle? & subtitle*)?
       
   258     & indexset?
       
   259     & abstract?
       
   260     & annotation?
       
   261 
       
   262 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   263 
       
   264 division = element division { division.attributes, division.content }
       
   265 
       
   266 division.attributes =
       
   267     division.type.attribute?
       
   268 division.type.attribute = attribute type { xsd:NCName }
       
   269 
       
   270 division.content =
       
   271     division.head?,
       
   272     front?,
       
   273     (division | document.topic)+
       
   274 
       
   275 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ front ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   276 
       
   277 front = element front { front.content }
       
   278 
       
   279 front.content =
       
   280     section+
       
   281 
       
   282 
       
   283 # =============================================================================
       
   284 #                                 COMPONENTS
       
   285 # =============================================================================
       
   286 
       
   287 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ component.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   288 
       
   289 # ~~~~~~ component.head
       
   290 component.head = element head { document.head.content }
       
   291 
       
   292 # ~~~~~~ document.component.head
       
   293 document.component.head = element head { document.component.head.content }
       
   294 
       
   295 document.component.head.content =
       
   296     (title & shorttitle? & subtitle*)?
       
   297     & contributors?
       
   298     & date?
       
   299     & place?
       
   300     & keywordset?
       
   301     & subjectset?
       
   302     & indexset?
       
   303     & abstract?
       
   304     & annotation?
       
   305 
       
   306 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   307 
       
   308 topic = element topic { topic.attributes, topic.content }
       
   309 document.topic =
       
   310     element topic { document.topic.attributes, document.topic.content }
       
   311 
       
   312 topic.attributes =
       
   313     topic.id.attribute?
       
   314     & topic.type.attribute?
       
   315     & lang.attribute?
       
   316 document.topic.attributes =
       
   317     (topic.id.attribute | xmlid.attribute)?
       
   318     & topic.type.attribute?
       
   319     & lang.attribute?
   237 topic.id.attribute = attribute id { xsd:NMTOKEN }
   320 topic.id.attribute = attribute id { xsd:NMTOKEN }
   238 topic.type.attribute = attribute type { xsd:NCName }
   321 topic.type.attribute = attribute type { xsd:NCName }
   239 
       
   240 top.topic.content =
       
   241    top.head?,
       
   242    header?,
       
   243    ((section+, bibliography?) | bibliography),
       
   244    footer?
       
   245 
       
   246 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glossary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   247 
       
   248 glossary = element glossary { glossary.attributes, glossary.content }
       
   249 
       
   250 glossary.attributes =
       
   251    glossary.type.attribute?
       
   252  & lang.attribute?
       
   253  & langto.attribute?
       
   254 glossary.type.attribute = attribute type { xsd:NCName }
       
   255 langto.attribute = attribute langto { xsd:language }
       
   256 
       
   257 glossary.content =
       
   258    glossary.entry+
       
   259 
       
   260 
       
   261 # =============================================================================
       
   262 #                                 DIVISION LEVEL
       
   263 # =============================================================================
       
   264 
       
   265 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   266 
       
   267 division.head = element head { division.head.content }
       
   268 
       
   269 division.head.content =
       
   270    (title & shorttitle? & subtitle*)?
       
   271  & indexset?
       
   272  & abstract?
       
   273  & annotation?
       
   274 
       
   275 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   276 
       
   277 division = element division { division.attributes, division.content }
       
   278 
       
   279 division.attributes =
       
   280    division.type.attribute?
       
   281 division.type.attribute = attribute type { xsd:NCName }
       
   282 
       
   283 division.content =
       
   284    division.head?,
       
   285    front?,
       
   286    (division | topic)+
       
   287 
       
   288 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ front ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   289 
       
   290 front = element front { front.content }
       
   291 
       
   292 front.content =
       
   293    section+
       
   294 
       
   295 
       
   296 # =============================================================================
       
   297 #                                COMPONENT LEVEL
       
   298 # =============================================================================
       
   299 
       
   300 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ component.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   301 
       
   302 component.head = element head { component.head.content }
       
   303 
       
   304 component.head.content =
       
   305    (title & shorttitle? & subtitle*)?
       
   306  & contributors?
       
   307  & date?
       
   308  & place?
       
   309  & keywordset?
       
   310  & subjectset?
       
   311  & indexset?
       
   312  & abstract?
       
   313  & annotation?
       
   314 
       
   315 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   316 
       
   317 topic = element topic { topic.attributes, topic.content }
       
   318 
       
   319 topic.attributes =
       
   320    (topic.id.attribute | xmlid.attribute)?
       
   321  & topic.type.attribute?
       
   322  & lang.attribute?
       
   323 xmlid.attribute = attribute xml:id { xsd:ID }
   322 xmlid.attribute = attribute xml:id { xsd:ID }
   324 
   323 
   325 topic.content =
   324 topic.content =
   326    component.head?,
   325     component.head?,
   327    header?,
   326     header?,
   328    ((section+, bibliography?) | bibliography),
   327     ((section+, bibliography?) | bibliography),
   329    footer?
   328     footer?
       
   329 document.topic.content =
       
   330     document.component.head?,
       
   331     header?,
       
   332     ((section+, bibliography?) | bibliography),
       
   333     footer?
   330 
   334 
   331 
   335 
   332 # =============================================================================
   336 # =============================================================================
   333 #                                 SECTION LEVEL
   337 #                                 SECTION LEVEL
   334 # =============================================================================
   338 # =============================================================================
   336 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   340 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   337 
   341 
   338 section.head = element head { section.head.content }
   342 section.head = element head { section.head.content }
   339 
   343 
   340 section.head.content =
   344 section.head.content =
   341    (title & shorttitle? & subtitle*)?
   345     (title & shorttitle? & subtitle*)?
   342  & keywordset?
   346     & keywordset?
   343  & subjectset?
   347     & subjectset?
   344  & indexset?
   348     & indexset?
   345  & abstract?
   349     & abstract?
   346  & audio*
   350     & audio*
   347  & annotation?
   351     & annotation?
   348 
   352 
   349 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   353 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   350 
   354 
   351 header = element header { header.content }
   355 header = element header { header.content }
   352 
   356 
   353 header.content =
   357 header.content =
   354    block+
   358     block+
   355 
   359 
   356 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   360 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   357 
   361 
   358 section = element section { section.attributes, section.content }
   362 section = element section { section.attributes, section.content }
   359 
   363 
   360 section.attributes =
   364 section.attributes =
   361    xmlid.attribute?
   365     xmlid.attribute?
   362  & section.type.attribute?
   366     & section.type.attribute?
   363  & lang.attribute?
   367     & lang.attribute?
   364  & for.attribute?
   368     & for.attribute?
   365 section.type.attribute = attribute type { xsd:NCName }
   369 section.type.attribute = attribute type { xsd:NCName }
   366 for.attribute = attribute for { xsd:NCName }
   370 for.attribute = attribute for { xsd:NCName }
   367 
   371 
   368 section.content =
   372 section.content =
   369    section.head?,
   373     section.head?,
   370    (section+ | block+)
   374     (section+ | block+)
   371 
   375 
   372 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   376 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   373 
   377 
   374 bibliography = element bibliography { bibliography.content }
   378 bibliography = element bibliography { bibliography.content }
   375 
   379 
   376 bibliography.content =
   380 bibliography.content =
   377    bibliography.entry+
   381     bibliography.entry+
   378 
   382 
   379 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   383 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   380 
   384 
   381 footer = element footer { footer.content }
   385 footer = element footer { footer.content }
   382 
   386 
   383 footer.content =
   387 footer.content =
   384    block+
   388     block+
   385 
   389 
   386 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glossary.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   390 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glossary.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   387 
   391 
   388 # ~~~~~~ glossary.entry
   392 # ~~~~~~ glossary.entry
   389 glossary.entry= element entry {
   393 glossary.entry=
   390    glossary.entry.attributes, glossary.entry.content }
   394     element entry { glossary.entry.attributes, glossary.entry.content }
   391 
   395 
   392 glossary.entry.attributes =
   396 glossary.entry.attributes =
   393    xmlid.attribute?
   397     xmlid.attribute?
   394 
   398 
   395 glossary.entry.content =
   399 glossary.entry.content =
   396    mainterm,
   400     mainterm,
   397    alt-terms?,
   401     alt-terms?,
   398    media?,
   402     media?,
   399    meanings+,
   403     meanings+,
   400    seealso*
   404     seealso*
   401 
   405 
   402 # ~~~~~~ mainterm
   406 # ~~~~~~ mainterm
   403 mainterm = element mainterm { mainterm.content }
   407 mainterm = element mainterm { mainterm.content }
   404 
   408 
   405 mainterm.content = simple.inlines
   409 mainterm.content = simple.inlines
   427 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   431 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   428 
   432 
   429 block.head = element head { block.head.content }
   433 block.head = element head { block.head.content }
   430 
   434 
   431 block.head.content =
   435 block.head.content =
   432    (title & shorttitle? & subtitle*)?
   436     (title & shorttitle? & subtitle*)?
   433  & indexset?
   437     & indexset?
   434  & annotation?
   438     & annotation?
   435 
   439 
   436 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   440 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   437 
   441 
   438 block = (p | \list | blockquote | speech | table | table.cals | media)
   442 block = (p | \list | blockquote | speech | table | table.cals | media)
   439 
   443 
   440 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   444 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   441 
   445 
   442 p = element p { p.content }
   446 p = element p { p.content }
   443 
   447 
   444 p.content =
   448 p.content =
   445    inlines
   449     inlines
   446 
   450 
   447 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   451 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   448 
   452 
   449 # ~~~~~~ list
   453 # ~~~~~~ list
   450 \list = element list {
   454 \list =
   451    block.head?,
   455     element list {
   452    (  (attribute type {"ordered"}?, item, item+)
   456         block.head?,
   453     | (attribute type {"glossary"}, item.glossary+) )
   457         ( (attribute type {"ordered"}?, item, item+) |
   454 }
   458           (attribute type {"glossary"}, item.glossary+) ) }
   455 
   459 
   456 # ~~~~~~ item
   460 # ~~~~~~ item
   457 item = element item { item.content }
   461 item = element item { item.content }
   458 
   462 
   459 item.content =
   463 item.content =
   460    inlines
   464     inlines
   461  | block+
   465     | block+
   462 
   466 
   463 # ~~~~~~ item.glossary
   467 # ~~~~~~ item.glossary
   464 item.glossary = element item { item.glossary.content }
   468 item.glossary = element item { item.glossary.content }
   465 
   469 
   466 item.glossary.content =
   470 item.glossary.content =
   467    label,
   471     label,
   468    block+
   472     block+
   469 
   473 
   470 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   474 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   471 
   475 
   472 # ~~~~~~ blockquote
   476 # ~~~~~~ blockquote
   473 blockquote = element blockquote { blockquote.attributes, blockquote.content }
   477 blockquote = element blockquote { blockquote.attributes, blockquote.content }
   474 
   478 
   475 blockquote.attributes =
   479 blockquote.attributes =
   476    blockquote.type.attribute?
   480     blockquote.type.attribute?
   477 blockquote.type.attribute = attribute type { xsd:NCName }
   481 blockquote.type.attribute = attribute type { xsd:NCName }
   478 
   482 
   479 blockquote.content =
   483 blockquote.content =
   480    block.head?,
   484     block.head?,
   481    (p | speech | \list)+,
   485     (p | speech | \list)+,
   482    attribution?
   486     attribution?
   483 
   487 
   484 # ~~~~~~ attribution
   488 # ~~~~~~ attribution
   485 attribution = element attribution { attribution.content }
   489 attribution = element attribution { attribution.content }
   486 
   490 
   487 attribution.content = mixed {
   491 attribution.content =
   488    sup* & number* & date* & name* & foreign* & acronym* & term* & literal*
   492     mixed {
   489  & highlight* & emphasis* & mentioned* & note* & warning* }
   493         sup* & number* & date* & name* & foreign* & acronym* & term* & literal*
       
   494         & highlight* & emphasis* & mentioned* & note* & warning* }
   490 
   495 
   491 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   496 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   492 
   497 
   493 # ~~~~~~ speech
   498 # ~~~~~~ speech
   494 speech = element speech { speech.content }
   499 speech = element speech { speech.content }
   495 
   500 
   496 speech.content =
   501 speech.content =
   497    speaker?,
   502     speaker?,
   498    stage?,
   503     stage?,
   499    (p | blockquote)+
   504     (p | blockquote)+
   500 
   505 
   501 # ~~~~~~ speaker
   506 # ~~~~~~ speaker
   502 speaker = element speaker { speaker.content }
   507 speaker = element speaker { speaker.content }
   503 
   508 
   504 speaker.content = inlines
   509 speaker.content = inlines
   507 
   512 
   508 # ~~~~~~ table
   513 # ~~~~~~ table
   509 table = element table { table.attributes, table.content }
   514 table = element table { table.attributes, table.content }
   510 
   515 
   511 table.attributes =
   516 table.attributes =
   512    table.type.attribute?
   517     table.type.attribute?
   513 table.type.attribute = attribute type { xsd:NCName }
   518 table.type.attribute = attribute type { xsd:NCName }
   514 
   519 
   515 table.content =
   520 table.content =
   516    block.head?,
   521     block.head?,
   517    ((thead?, tbody+) | tr+),
   522     ((thead?, tbody+) | tr+),
   518    table.caption?
   523     table.caption?
   519 
   524 
   520 # ~~~~~~ thead, tbody
   525 # ~~~~~~ thead, tbody
   521 thead = element thead { thead.content }
   526 thead = element thead { thead.content }
   522 tbody = element tbody { tbody.content }
   527 tbody = element tbody { tbody.content }
   523 
   528 
   524 thead.content =
   529 thead.content =
   525    tr+
   530     tr+
   526 tbody.content =
   531 tbody.content =
   527    tr+
   532     tr+
   528 
   533 
   529 # ~~~~~~ tr
   534 # ~~~~~~ tr
   530 tr = element tr { tr.attributes, tr.content }
   535 tr = element tr { tr.attributes, tr.content }
   531 
   536 
   532 tr.attributes =
   537 tr.attributes =
   533    align.attribute?
   538     align.attribute?
   534  & valign.attribute?
   539     & valign.attribute?
   535  & cell.type.attribute?
   540     & cell.type.attribute?
   536 align.attribute = attribute align { "left"  |  "right"  | "center" | "justify" }
   541 align.attribute = attribute align { "left"  |  "right"  | "center" | "justify" }
   537 valign.attribute = attribute valign { "top" | "middle" | "bottom" }
   542 valign.attribute = attribute valign { "top" | "middle" | "bottom" }
   538 cell.type.attribute = attribute type { xsd:NCName }
   543 cell.type.attribute = attribute type { xsd:NCName }
   539 
   544 
   540 tr.content =
   545 tr.content =
   541    (td | th)+
   546     (td | th)+
   542 
   547 
   543 # ~~~~~~ td, th
   548 # ~~~~~~ td, th
   544 td = element td { td.attributes, td.content }
   549 td = element td { td.attributes, td.content }
   545 th = element th { td.attributes, td.content }
   550 th = element th { td.attributes, td.content }
   546 
   551 
   547 td.attributes =
   552 td.attributes =
   548    align.attribute?
   553     align.attribute?
   549  & valign.attribute?
   554     & valign.attribute?
   550  & colspan.attribute?
   555     & colspan.attribute?
   551  & rowspan.attribute?
   556     & rowspan.attribute?
   552  & cell.type.attribute?
   557     & cell.type.attribute?
   553 colspan.attribute = attribute colspan { xsd:positiveInteger }
   558 colspan.attribute = attribute colspan { xsd:positiveInteger }
   554 rowspan.attribute = attribute rowspan { xsd:positiveInteger }
   559 rowspan.attribute = attribute rowspan { xsd:positiveInteger }
   555 
   560 
   556 td.content =
   561 td.content =
   557    inlines
   562     inlines
   558  | (p | media)+
   563     | (p | media)+
   559 
   564 
   560 # ~~~~~~ table.caption
   565 # ~~~~~~ table.caption
   561 table.caption = element caption { caption.content }
   566 table.caption = element caption { caption.content }
   562 
   567 
   563 caption.content =
   568 caption.content =
   564    inlines
   569     inlines
   565  | (p | speech | \list | blockquote)+
   570     | (p | speech | \list | blockquote)+
   566 
   571 
   567 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table.cals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   572 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table.cals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   568 
   573 
   569 # ~~~~~~ table.cals
   574 # ~~~~~~ table.cals
   570 table.cals = element table { table.attributes, table.cals.content }
   575 table.cals = element table { table.attributes, table.cals.content }
   571 
   576 
   572 table.cals.content =
   577 table.cals.content =
   573    block.head?,
   578     block.head?,
   574    tgroup+,
   579     tgroup+,
   575    table.caption?
   580     table.caption?
   576 
   581 
   577 # ~~~~~~ tgroup
   582 # ~~~~~~ tgroup
   578 tgroup = element tgroup { tgroup.attributes, tgroup.content }
   583 tgroup = element tgroup { tgroup.attributes, tgroup.content }
   579 
   584 
   580 tgroup.attributes =
   585 tgroup.attributes =
   581    cols.attribute
   586     cols.attribute
   582 cols.attribute = attribute cols { xsd:positiveInteger }
   587 cols.attribute = attribute cols { xsd:positiveInteger }
   583 
   588 
   584 tgroup.content =
   589 tgroup.content =
   585    thead.cals?,
   590     thead.cals?,
   586    tbody.cals
   591     tbody.cals
   587 
   592 
   588 # ~~~~~~ thead, tbody
   593 # ~~~~~~ thead, tbody
   589 thead.cals = element thead { thead.cals.content }
   594 thead.cals = element thead { thead.cals.content }
   590 tbody.cals = element tbody { tbody.cals.content }
   595 tbody.cals = element tbody { tbody.cals.content }
   591 
   596 
   592 thead.cals.content =
   597 thead.cals.content =
   593    row+
   598     row+
   594 tbody.cals.content =
   599 tbody.cals.content =
   595    row+
   600     row+
   596 
   601 
   597 # ~~~~~~ row
   602 # ~~~~~~ row
   598 row = element row { row.attributes, row.content }
   603 row = element row { row.attributes, row.content }
   599 
   604 
   600 row.attributes =
   605 row.attributes =
   601    valign.attribute?
   606     valign.attribute?
   602 
   607 
   603 row.content =
   608 row.content =
   604   table.cals.entry+
   609     table.cals.entry+
   605 
   610 
   606 # ~~~~~~ table.cals.entry
   611 # ~~~~~~ table.cals.entry
   607 table.cals.entry = element entry {
   612 table.cals.entry =
   608    table.cals.entry.attributes, table.cals.entry.content }
   613     element entry { table.cals.entry.attributes, table.cals.entry.content }
   609 
   614 
   610 table.cals.entry.attributes =
   615 table.cals.entry.attributes =
   611    align.attribute?
   616     align.attribute?
   612  & valign.attribute?
   617     & valign.attribute?
   613 
   618 
   614 table.cals.entry.content =
   619 table.cals.entry.content =
   615    inlines
   620     inlines
   616  | (p | media)+
   621     | (p | media)+
   617 
   622 
   618 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   623 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   619 
   624 
   620 # ~~~~~~ media
   625 # ~~~~~~ media
   621 media = element media { media.attributes, media.content }
   626 media = element media { media.attributes, media.content }
   622 
   627 
   623 media.attributes =
   628 media.attributes =
   624    xmlid.attribute?
   629     xmlid.attribute?
   625  & media.type.attribute?
   630     & media.type.attribute?
   626 media.type.attribute = attribute type { xsd:NCName }
   631 media.type.attribute = attribute type { xsd:NCName }
   627 
   632 
   628 media.content =
   633 media.content =
   629    block.head?,
   634     block.head?,
   630    (media.image | audio | video)+,
   635     (media.image | audio | video)+,
   631    media.caption?,
   636     media.caption?,
   632    link?
   637     link?
   633 
   638 
   634 # ~~~~~~ image
   639 # ~~~~~~ image
   635 image = element image { image.attributes }
   640 image = element image { image.attributes }
   636 media.image = element image { image.attributes, media.image.content }
   641 media.image = element image { image.attributes, media.image.content }
   637 
   642 
   638 image.attributes =
   643 image.attributes =
   639    media.id.attribute
   644     media.id.attribute
   640  & image.type.attribute?
   645     & image.type.attribute?
   641  & image.zoom.attribute?
   646     & image.zoom.attribute?
   642  & alt.attribute?
   647     & alt.attribute?
   643 media.id.attribute = attribute id { xsd:NMTOKEN }
   648 media.id.attribute = attribute id { xsd:NMTOKEN }
   644 image.type.attribute = attribute type {
   649 image.type.attribute =
   645    "cover" | "thumbnail" | "icon" | "animation" }
   650     attribute type { "cover" | "thumbnail" | "icon" | "animation" }
   646 image.zoom.attribute = attribute zoom {"true" | "false"}
   651 image.zoom.attribute = attribute zoom {"true" | "false"}
   647 alt.attribute = attribute alt { text }
   652 alt.attribute = attribute alt { text }
   648 
   653 
   649 media.image.content =
   654 media.image.content =
   650    copyright?,
   655     copyright?,
   651    hotspot*
   656     hotspot*
   652 
   657 
   653 # ~~~~~~ audio
   658 # ~~~~~~ audio
   654 audio = element audio { audio.attributes }
   659 audio = element audio { audio.attributes }
   655 
   660 
   656 audio.attributes =
   661 audio.attributes =
   657    media.id.attribute
   662     media.id.attribute
   658  & audio.type?
   663     & audio.type?
   659 audio.type = attribute type { "music" | "voice" | "en" | "fr" | "background"
   664 audio.type =
   660  | "smil" }
   665     attribute type { "music" | "voice" | "en" | "fr" | "background" | "smil" }
   661 
   666 
   662 # ~~~~~~ video
   667 # ~~~~~~ video
   663 video = element video { video.attributes }
   668 video = element video { video.attributes }
   664 
   669 
   665 video.attributes =
   670 video.attributes =
   666    media.id.attribute
   671     media.id.attribute
   667 
   672 
   668 # ~~~~~~ media.caption
   673 # ~~~~~~ media.caption
   669 media.caption = element caption { caption.attributes, caption.content }
   674 media.caption = element caption { caption.attributes, caption.content }
   670 
   675 
   671 caption.attributes =
   676 caption.attributes =
   672    x.attribute?
   677     x.attribute?
   673  & y.attribute?
   678     & y.attribute?
   674 
   679 
   675 # ~~~~~~ hotspot
   680 # ~~~~~~ hotspot
   676 hotspot = element hotspot { hotspot.attributes, hotspot.content }
   681 hotspot = element hotspot { hotspot.attributes, hotspot.content }
   677 
   682 
   678 hotspot.attributes =
   683 hotspot.attributes =
   679    x.attribute
   684     x.attribute
   680  & y.attribute
   685     & y.attribute
   681  & w.attribute
   686     & w.attribute
   682  & h.attribute?
   687     & h.attribute?
   683  & hotspot.display.attribute?
   688     & hotspot.display.attribute?
   684  & hotspot.type.attribute?
   689     & hotspot.type.attribute?
   685  & xmlid.attribute?
   690     & xmlid.attribute?
   686 x.attribute = attribute x { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   691 x.attribute = attribute x { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   687 y.attribute = attribute y { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   692 y.attribute = attribute y { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   688 w.attribute = attribute w { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   693 w.attribute = attribute w { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   689 h.attribute = attribute h { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   694 h.attribute = attribute h { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   690 hotspot.display.attribute = attribute display { "normal" | "visible" | "pulse" }
   695 hotspot.display.attribute = attribute display { "normal" | "visible" | "pulse" }
   691 hotspot.type.attribute = attribute type { xsd:NCName }
   696 hotspot.type.attribute = attribute type { xsd:NCName }
   692 
   697 
   693 hotspot.content =
   698 hotspot.content =
   694    ((link | p+ | image | audio | video), (spot, scenario?)?)
   699     ((link | p+ | image | audio | video), (spot, scenario?)?)
   695  | (spot, scenario?)
   700     | (spot, scenario?)
   696  | empty
   701     | empty
   697 
   702 
   698 # ~~~~~~ spot
   703 # ~~~~~~ spot
   699 spot = element spot { spot.attributes, spot.content }
   704 spot = element spot { spot.attributes, spot.content }
   700 
   705 
   701 spot.attributes =
   706 spot.attributes =
   702    dx.attribute?
   707     dx.attribute?
   703  & dy.attribute?
   708     & dy.attribute?
   704  & dw.attribute?
   709     & dw.attribute?
   705  & dh.attribute?
   710     & dh.attribute?
   706 dx.attribute = attribute dx { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   711 dx.attribute = attribute dx { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   707 dy.attribute = attribute dy { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   712 dy.attribute = attribute dy { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   708 dw.attribute = attribute dw { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   713 dw.attribute = attribute dw { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   709 dh.attribute = attribute dh { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   714 dh.attribute = attribute dh { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   710 
   715 
   711 spot.content =
   716 spot.content =
   712    ((p+ | image), audio?)
   717     ((p+ | image), audio?)
   713  | audio
   718     | audio
   714  | video
   719     | video
   715 
   720 
   716 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scenario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   721 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scenario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   717 
   722 
   718 # ~~~~~~ scenario
   723 # ~~~~~~ scenario
   719 scenario = element scenario { scenario.content }
   724 scenario = element scenario { scenario.content }
   720 
   725 
   721 scenario.content =
   726 scenario.content =
   722    init*,
   727     init*,
   723    onclick*
   728     onclick*
   724 
   729 
   725 # ~~~~~~ init
   730 # ~~~~~~ init
   726 init = element init { init.attributes }
   731 init = element init { init.attributes }
   727 
   732 
   728 init.attributes =
   733 init.attributes =
   729    init.action.attribute
   734     init.action.attribute
   730  & target.attribute?
   735     & target.attribute?
   731 init.action.attribute = attribute action { "hide" }
   736 init.action.attribute = attribute action { "hide" }
   732 target.attribute = attribute target { "hotspot" | "spot" }
   737 target.attribute = attribute target { "hotspot" | "spot" }
   733 
   738 
   734 # ~~~~~~ onclick
   739 # ~~~~~~ onclick
   735 onclick = element onclick { onclick.attributes }
   740 onclick = element onclick { onclick.attributes }
   736 
   741 
   737 onclick.attributes =
   742 onclick.attributes =
   738    onclick.action.attribute
   743     onclick.action.attribute
   739  & target.attribute?
   744     & target.attribute?
   740 onclick.action.attribute = attribute action { "show" }
   745 onclick.action.attribute = attribute action { "show" }
   741 
   746 
   742 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   747 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   743 
   748 
   744 # ~~~~~~ bibliography.entry
   749 # ~~~~~~ bibliography.entry
   745 bibliography.entry = element entry { bibliography.entry.content }
   750 bibliography.entry = element entry { bibliography.entry.content }
   746 
   751 
   747 bibliography.entry.content =
   752 bibliography.entry.content =
   748    identifier.ean?
   753     identifier.ean?
   749  & title
   754     & title
   750  & subtitle?
   755     & subtitle?
   751  & copyright?
   756     & copyright?
   752  & collection?
   757     & collection?
   753  & contributors?
   758     & contributors?
   754  & date?
   759     & date?
   755  & place?
   760     & place?
   756  & folio?
   761     & folio?
   757  & pages?
   762     & pages?
   758 
   763 
   759 # ~~~~~~ folio
   764 # ~~~~~~ folio
   760 folio = element folio { folio.content }
   765 folio = element folio { folio.content }
   761 
   766 
   762 folio.content = xsd:positiveInteger | xsd:token {pattern = "[DLXVI]+"}
   767 folio.content = xsd:positiveInteger | xsd:token {pattern = "[DLXVI]+"}
   770 
   775 
   771 # ~~~~~~ meanings
   776 # ~~~~~~ meanings
   772 meanings = element meanings { meanings.attributes, meanings.content }
   777 meanings = element meanings { meanings.attributes, meanings.content }
   773 
   778 
   774 meanings.attributes =
   779 meanings.attributes =
   775    gramcode.attribute?
   780     gramcode.attribute?
   776 gramcode.attribute = attribute gramcode { xsd:NMTOKEN }
   781 gramcode.attribute = attribute gramcode { xsd:NMTOKEN }
   777 
   782 
   778 meanings.content =
   783 meanings.content =
   779    meaning+
   784     meaning+
   780 
   785 
   781 # ~~~~~~ meaning
   786 # ~~~~~~ meaning
   782 meaning = element meaning { meaning.attributes, meaning.content }
   787 meaning = element meaning { meaning.attributes, meaning.content }
   783 
   788 
   784 meaning.attributes =
   789 meaning.attributes =
   785    meaning.domain.attribute?
   790     meaning.domain.attribute?
   786  & langlevel.attribute?
   791     & langlevel.attribute?
   787 meaning.domain.attribute = attribute domain { xsd:NMTOKEN }
   792 meaning.domain.attribute = attribute domain { xsd:NMTOKEN }
   788 langlevel.attribute = attribute langlevel { xsd:NMTOKEN }
   793 langlevel.attribute = attribute langlevel { xsd:NMTOKEN }
   789 
   794 
   790 meaning.content =
   795 meaning.content =
   791    ((definition, example*, synonym*, antonym*, translation*)
   796     ((definition, example*, synonym*, antonym*, translation*)
   792     | (definition?, example*, synonym*, antonym*, translation+)
   797     | (definition?, example*, synonym*, antonym*, translation+)
   793     | (definition?, example*, synonym+, antonym*, translation*)
   798     | (definition?, example*, synonym+, antonym*, translation*)
   794     | (definition?, example*, synonym*, antonym+, translation*)),
   799     | (definition?, example*, synonym*, antonym+, translation*)),
   795    dictum*
   800     dictum*
   796 
   801 
   797 # ~~~~~~ definition
   802 # ~~~~~~ definition
   798 definition = element definition { inlines }
   803 definition = element definition { inlines }
   799 
   804 
   800 # ~~~~~~ synonym, antonym
   805 # ~~~~~~ synonym, antonym
   811 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ seealso ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   816 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ seealso ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   812 
   817 
   813 seealso = element seealso { seealso.attributes }
   818 seealso = element seealso { seealso.attributes }
   814 
   819 
   815 seealso.attributes =
   820 seealso.attributes =
   816    gloss.ref.attribute
   821     gloss.ref.attribute
   817 
   822 
   818 
   823 
   819 # =============================================================================
   824 # =============================================================================
   820 #                                 INLINE LEVEL
   825 #                                 INLINE LEVEL
   821 # =============================================================================
   826 # =============================================================================
   822 
   827 
   823 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   828 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   824 
   829 
   825 simple.inlines = mixed {
   830 simple.inlines =
   826    sup*
   831     mixed {
   827  & sub*
   832         sup* & sub*
   828  & var*
   833         & var*
   829  & number*
   834         & number*
   830  & acronym*
   835         & acronym*
   831  & warning*
   836         & warning*
   832 }
   837     }
   833 
   838 
   834 inlines = mixed {
   839 inlines =
   835    sup*
   840     mixed {
   836  & sub*
   841         sup* & sub*
   837  & var*
   842         & var*
   838  & number*
   843         & number*
   839  & acronym*
   844         & acronym*
   840  & warning*
   845         & warning*
   841 
   846 
   842  & highlight*
   847         & highlight*
   843  & emphasis*
   848         & emphasis*
   844  & mentioned*
   849         & mentioned*
   845  & literal*
   850         & literal*
   846  & term*
   851         & term*
   847  & example*
   852         & example*
   848  & stage*
   853         & stage*
   849  & name*
   854         & name*
   850  & foreign*
   855         & foreign*
   851  & date*
   856         & date*
   852  & math*
   857         & math*
   853  & quote*
   858         & quote*
   854  & initial*
   859         & initial*
   855  & note*
   860         & note*
   856  & link*
   861         & link*
   857  & anchor*
   862         & anchor*
   858  & index*
   863         & index*
   859  & gloss*
   864         & gloss*
   860  & image*
   865         & image*
   861  & audio*
   866         & audio*
   862  & smil*
   867         & smil*
   863 
   868 
   864  & nowrap*
   869         & nowrap*
   865 }
   870     }
   866 
   871 
   867 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   872 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   868 
   873 
   869 sup = element sup { mixed { var* & warning* } }
   874 sup = element sup { mixed { var* & warning* } }
   870 
   875 
   872 
   877 
   873 var = element var { mixed { warning* } }
   878 var = element var { mixed { warning* } }
   874 
   879 
   875 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   880 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   876 
   881 
   877 number = element number {
   882 number =
   878    ( attribute type {"roman"}, number.attributes, number.roman.content )
   883     element number {
   879  | ( number.attributes, number.content)
   884         ( attribute type {"roman"}, number.attributes, number.roman.content ) |
   880 }
   885         ( number.attributes, number.content)
       
   886     }
   881 
   887 
   882 number.attributes =
   888 number.attributes =
   883    number.value.attribute?
   889     number.value.attribute?
   884 number.value.attribute = attribute value { xsd:integer | xsd:decimal }
   890 number.value.attribute = attribute value { xsd:integer | xsd:decimal }
   885 
   891 
   886 number.content = mixed { sup* & warning* }
   892 number.content = mixed { sup* & warning* }
   887 number.roman.content = xsd:token {pattern = "[MCLXVI]+"}
   893 number.roman.content = xsd:token {pattern = "[MCLXVI]+"}
   888 
   894 
   937 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   943 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   938 
   944 
   939 name = element name { name.attributes, name.content }
   945 name = element name { name.attributes, name.content }
   940 
   946 
   941 name.attributes =
   947 name.attributes =
   942    name.of.attribute?
   948     name.of.attribute?
   943 name.of.attribute = attribute of {
   949 name.of.attribute =
   944    "person" | "company" | "book" | "newspaper" | "party" | "movie"
   950     attribute of {
   945  | "painting" }
   951         "person" | "company" | "book" | "newspaper" | "party" | "movie"
       
   952         | "painting" }
   946 
   953 
   947 name.content = mixed { sup* & number* & acronym* & warning* }
   954 name.content = mixed { sup* & number* & acronym* & warning* }
   948 
   955 
   949 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   956 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   950 
   957 
   951 foreign = element foreign { foreign.attributes, foreign.content }
   958 foreign = element foreign { foreign.attributes, foreign.content }
   952 
   959 
   953 foreign.attributes =
   960 foreign.attributes =
   954    lang.attribute?
   961     lang.attribute?
   955 
   962 
   956 foreign.content = inlines
   963 foreign.content = inlines
   957 
   964 
   958 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   965 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   959 
   966 
   960 date = element date { date.attributes, date.content }
   967 date = element date { date.attributes, date.content }
   961 
   968 
   962 date.attributes =
   969 date.attributes =
   963    date.value.attribute
   970     date.value.attribute
   964  & date.of.attribute?
   971     & date.of.attribute?
   965 date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear }
   972 date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear }
   966 date.of.attribute = attribute of { "birth" | "death" }
   973 date.of.attribute = attribute of { "birth" | "death" }
   967 
   974 
   968 date.content = mixed { sup* & number* & warning* }
   975 date.content = mixed { sup* & number* & warning* }
   969 
   976 
   971 
   978 
   972 # ~~~~~~ math
   979 # ~~~~~~ math
   973 math = element math { math.attributes, math.content }
   980 math = element math { math.attributes, math.content }
   974 
   981 
   975 math.attributes =
   982 math.attributes =
   976    xmlid.attribute?
   983     xmlid.attribute?
   977  & math.display.attribute?
   984     & math.display.attribute?
   978  & math.type.attribute?
   985     & math.type.attribute?
   979 math.display.attribute = attribute display {
   986 math.display.attribute =
   980    "wide" | "numbered" | "box"  | "numbered-box" }
   987     attribute display { "wide" | "numbered" | "box"  | "numbered-box" }
   981 math.type.attribute = attribute type { xsd:NCName }
   988 math.type.attribute = attribute type { xsd:NCName }
   982 
   989 
   983 math.content =
   990 math.content =
   984    mixed { sup* & sub* & var* & warning* }
   991     mixed { sup* & sub* & var* & warning* }
   985  | (preambule?, latex)
   992     | (preambule?, latex)
   986 
   993 
   987 # ~~~~~~ latex
   994 # ~~~~~~ latex
   988 latex = element latex { latex.attributes, latex.content }
   995 latex = element latex { latex.attributes, latex.content }
   989 
   996 
   990 latex.attributes =
   997 latex.attributes =
   991    plain.attritute?
   998     plain.attritute?
   992 plain.attritute = attribute plain { xsd:boolean }
   999 plain.attritute = attribute plain { xsd:boolean }
   993 
  1000 
   994 latex.content = text
  1001 latex.content = text
   995 
  1002 
   996 # ~~~~~~ preambule
  1003 # ~~~~~~ preambule
  1011 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1018 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1012 
  1019 
  1013 quote = element quote { quote.content }
  1020 quote = element quote { quote.content }
  1014 
  1021 
  1015 quote.content =
  1022 quote.content =
  1016    (phrase, attribution) | inlines
  1023     (phrase, attribution) | inlines
  1017 
  1024 
  1018 phrase = element phrase { phrase.content }
  1025 phrase = element phrase { phrase.content }
  1019 
  1026 
  1020 phrase.content = inlines
  1027 phrase.content = inlines
  1021 
  1028 
  1022 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ initial ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1029 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ initial ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1023 
  1030 
  1024 initial = element initial { initial.content }
  1031 initial = element initial { initial.content }
  1025 
  1032 
  1026 initial.content =
  1033 initial.content =
  1027    initial.c,
  1034     initial.c,
  1028    initial.w?
  1035     initial.w?
  1029 
  1036 
  1030 initial.c = element c { text }
  1037 initial.c = element c { text }
  1031 initial.w = element w { inlines }
  1038 initial.w = element w { inlines }
  1032 
  1039 
  1033 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1040 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1034 
  1041 
  1035 note = element note { note.attributes, note.content }
  1042 note = element note { note.attributes, note.content }
  1036 
  1043 
  1037 note.attributes =
  1044 note.attributes =
  1038    note.label.attribute?
  1045     note.label.attribute?
  1039 note.label.attribute = attribute label { text }
  1046 note.label.attribute = attribute label { text }
  1040 
  1047 
  1041 note.content =
  1048 note.content =
  1042    (note.w?, block+)
  1049     (note.w?, block+)
  1043  | inlines
  1050     | inlines
  1044 
  1051 
  1045 note.w = element w { inlines }
  1052 note.w = element w { inlines }
  1046 
  1053 
  1047 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1054 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1048 
  1055 
  1049 link = element link { link.attributes, link.content }
  1056 link = element link { link.attributes, link.content }
  1050 
  1057 
  1051 link.attributes =
  1058 link.attributes =
  1052    (uri.attribute | idref.attribute)
  1059     (uri.attribute | idref.attribute)
  1053 uri.attribute = attribute uri { xsd:anyURI }
  1060 uri.attribute = attribute uri { xsd:anyURI }
  1054 idref.attribute = attribute idref { xsd:IDREF }
  1061 idref.attribute = attribute idref { xsd:IDREF }
  1055 
  1062 
  1056 link.content = simple.inlines
  1063 link.content = simple.inlines
  1057 
  1064 
  1058 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1065 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1059 
  1066 
  1060 anchor = element anchor { anchor.attributes, anchor.content }
  1067 anchor = element anchor { anchor.attributes, anchor.content }
  1061 
  1068 
  1062 anchor.attributes =
  1069 anchor.attributes =
  1063    anchor.id.attribute
  1070     anchor.id.attribute
  1064 anchor.id.attribute = attribute xml:id { xsd:ID }
  1071 anchor.id.attribute = attribute xml:id { xsd:ID }
  1065 
  1072 
  1066 anchor.content = simple.inlines
  1073 anchor.content = simple.inlines
  1067 
  1074 
  1068 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gloss ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1075 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gloss ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1069 
  1076 
  1070 gloss = element gloss { gloss.attributes, gloss.content }
  1077 gloss = element gloss { gloss.attributes, gloss.content }
  1071 
  1078 
  1072 gloss.attributes =
  1079 gloss.attributes =
  1073    gloss.ref.attribute
  1080     gloss.ref.attribute
  1074 gloss.ref.attribute = attribute ref { xsd:NCName }
  1081 gloss.ref.attribute = attribute ref { xsd:NCName }
  1075 
  1082 
  1076 gloss.content = simple.inlines
  1083 gloss.content = simple.inlines
  1077 
  1084 
  1078 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ smil ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1085 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ smil ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1079 
  1086 
  1080 smil = element smil { smil.attributes, smil.content }
  1087 smil = element smil { smil.attributes, smil.content }
  1081 
  1088 
  1082 smil.attributes =
  1089 smil.attributes =
  1083    audio.attribute?
  1090     audio.attribute?
  1084  & begin.attribute?
  1091     & begin.attribute?
  1085  & end.attribute?
  1092     & end.attribute?
  1086 audio.attribute = attribute audio { xsd:anyURI }
  1093 audio.attribute = attribute audio { xsd:anyURI }
  1087 begin.attribute = attribute begin { xsd:decimal }
  1094 begin.attribute = attribute begin { xsd:decimal }
  1088 end.attribute = attribute end { xsd:decimal }
  1095 end.attribute = attribute end { xsd:decimal }
  1089 
  1096 
  1090 smil.content = inlines
  1097 smil.content = inlines
  1098 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1105 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1099 
  1106 
  1100 warning = element warning { warning.attributes, warning.content }
  1107 warning = element warning { warning.attributes, warning.content }
  1101 
  1108 
  1102 warning.attributes =
  1109 warning.attributes =
  1103    warning.type.attribute?
  1110     warning.type.attribute?
  1104 warning.type.attribute = attribute type { xsd:NCName }
  1111 warning.type.attribute = attribute type { xsd:NCName }
  1105 
  1112 
  1106 warning.content = inlines
  1113 warning.content = inlines