RelaxNG/publidoc.rnc
changeset 90 d5067911c762
parent 86 2d51a1795ed3
child 91 2ed9fc840ce6
equal deleted inserted replaced
89:208625c74410 90:d5067911c762
    19 
    19 
    20 # =============================================================================
    20 # =============================================================================
    21 #                                  TOP LEVEL
    21 #                                  TOP LEVEL
    22 # =============================================================================
    22 # =============================================================================
    23 
    23 
    24 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    24 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    25 
       
    26 document = element document { document.attributes, document.content }
       
    27 
       
    28 document.attributes =
       
    29    document.id.attribute
       
    30  & lang.attribute?
       
    31 document.id.attribute = attribute xml:id { xsd:ID }
       
    32 lang.attribute = attribute xml:lang { xsd:language }
       
    33 
       
    34 document.content =
       
    35    top.head?,
       
    36    (division | topic)+
       
    37 
       
    38 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
    39 
       
    40 top.topic = element topic { top.topic.attributes, top.topic.content }
       
    41 
       
    42 top.topic.attributes =
       
    43    topic.id.attribute
       
    44  & topic.type.attribute?
       
    45  & lang.attribute?
       
    46 topic.id.attribute = attribute xml:id { xsd:ID }
       
    47 topic.type.attribute = attribute type { xsd:NCName }
       
    48 
       
    49 top.topic.content =
       
    50    top.head?,
       
    51    section+
       
    52 
       
    53 
       
    54 # =============================================================================
       
    55 #                                 HEAD LEVEL
       
    56 # =============================================================================
       
    57 
       
    58 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
    59 
    25 
    60 top.head = element head { top.head.content }
    26 top.head = element head { top.head.content }
    61 division.head = element head { division.head.content }
       
    62 component.head = element head { component.head.content }
       
    63 section.head = element head { section.head.content }
       
    64 block.head = element head { block.head.content }
       
    65 
    27 
    66 top.head.content =
    28 top.head.content =
    67    (title, subtitle?)?
    29    (title, subtitle?)?
    68  & identifier*
    30  & identifier*
    69  & copyright?
    31  & copyright?
    74  & keywordset?
    36  & keywordset?
    75  & subjectset?
    37  & subjectset?
    76  & abstract?
    38  & abstract?
    77  & cover?
    39  & cover?
    78  & annotation*
    40  & annotation*
       
    41 
       
    42 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
    43 
       
    44 # ~~~~~~ document
       
    45 document = element document { document.attributes, document.content }
       
    46 
       
    47 document.attributes =
       
    48    document.id.attribute
       
    49  & lang.attribute?
       
    50 document.id.attribute = attribute xml:id { xsd:ID }
       
    51 lang.attribute = attribute xml:lang { xsd:language }
       
    52 
       
    53 document.content =
       
    54    top.head?,
       
    55    (division | topic)+
       
    56 
       
    57 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
    58 
       
    59 top.topic = element topic { top.topic.attributes, top.topic.content }
       
    60 
       
    61 top.topic.attributes =
       
    62    topic.id.attribute
       
    63  & topic.type.attribute?
       
    64  & lang.attribute?
       
    65 topic.id.attribute = attribute xml:id { xsd:ID }
       
    66 topic.type.attribute = attribute type { xsd:NCName }
       
    67 
       
    68 top.topic.content =
       
    69    top.head?,
       
    70    section+
       
    71 
       
    72 
       
    73 # =============================================================================
       
    74 #                                 DIVISION LEVEL
       
    75 # =============================================================================
       
    76 
       
    77 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
    78 
       
    79 # ~~~~~~ division
       
    80 division = element division { division.content }
       
    81 
       
    82 division.content =
       
    83    division.head?,
       
    84    (division | topic)+
       
    85 
       
    86 # ~~~~~~ division.head
       
    87 division.head = element head { division.head.content }
       
    88 
    79 division.head.content =
    89 division.head.content =
    80    (title, subtitle?)?
    90    (title, subtitle?)?
    81  & abstract?
    91  & abstract?
    82  & annotation*
    92  & annotation*
       
    93 
       
    94 
       
    95 # =============================================================================
       
    96 #                                COMPONENT LEVEL
       
    97 # =============================================================================
       
    98 
       
    99 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ component.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   100 
       
   101 component.head = element head { component.head.content }
       
   102 
    83 component.head.content =
   103 component.head.content =
    84    (title, subtitle?)?
   104    (title, subtitle?)?
    85  & contributors?
   105  & contributors?
    86  & abstract?
   106  & abstract?
    87  & annotation*
   107  & annotation*
       
   108 
       
   109 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   110 
       
   111 topic = element topic { topic.attributes, topic.content }
       
   112 
       
   113 topic.attributes =
       
   114    topic.id.attribute?
       
   115  & topic.type.attribute?
       
   116  & lang.attribute?
       
   117 
       
   118 topic.content =
       
   119    component.head?,
       
   120    section+
       
   121 
       
   122 
       
   123 # =============================================================================
       
   124 #                                 SECTION LEVEL
       
   125 # =============================================================================
       
   126 
       
   127 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   128 
       
   129 # ~~~~~~ section
       
   130 section = element section { section.attributes, section.content }
       
   131 
       
   132 section.attributes =
       
   133    section.type.attribute?
       
   134  & lang.attribute?
       
   135 section.type.attribute = attribute type { xsd:NCName }
       
   136 
       
   137 section.content =
       
   138    section.head?,
       
   139    (section+ | block+)
       
   140 
       
   141 # ~~~~~~ section.head
       
   142 section.head = element head { section.head.content }
       
   143 
    88 section.head.content =
   144 section.head.content =
    89    (title, subtitle?)?
   145    (title, subtitle?)?
    90  & abstract?
   146  & abstract?
    91  & annotation*
   147  & annotation*
       
   148 
       
   149 
       
   150 # =============================================================================
       
   151 #                                 BLOCK LEVEL
       
   152 # =============================================================================
       
   153 
       
   154 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   155 
       
   156 # ~~~~~~ block
       
   157 block = (p | speech | \list | blockquote | table | media)
       
   158 
       
   159 # ~~~~~~ block.head
       
   160 block.head = element head { block.head.content }
       
   161 
    92 block.head.content =
   162 block.head.content =
    93    (title, subtitle?)?
   163    (title, subtitle?)?
    94 
       
    95 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
    96 
       
    97 title = element title { title.content }
       
    98 subtitle = element subtitle { title.content }
       
    99 
       
   100 title.content = inlines
       
   101 
       
   102 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   103 
       
   104 identifier.uri = element identifier {
       
   105    attribute type { "uri" }, xsd:anyURI
       
   106 }
       
   107 
       
   108 identifier.ean = element identifier {
       
   109    attribute type { "ean" }, xsd:token {pattern = "\d{13}"}
       
   110 }
       
   111 
       
   112 identifier = identifier.uri | identifier.ean
       
   113 
       
   114 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   115 
       
   116 copyright = element copyright { copyright.content }
       
   117 
       
   118 copyright.content = inlines
       
   119 
       
   120 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ contributors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   121 
       
   122 # ~~~~~~ contributors
       
   123 contributors = element contributors { contributors.content }
       
   124 
       
   125 contributors.content =
       
   126    contributor+
       
   127 
       
   128 # ~~~~~~ contributor
       
   129 contributor = element contributor { contributor.content }
       
   130 
       
   131 contributor.content =
       
   132    (((firstname, secondname?)?, lastname) | label),
       
   133    address?,
       
   134    link?,
       
   135    role*
       
   136 
       
   137 # ~~~~~~ firstname, secondname, lastname, label
       
   138 firstname = element firstname { firstname.content }
       
   139 secondname = element secondname { secondname.content }
       
   140 lastname = element lastname { lastname.content }
       
   141 label = element label { label.content }
       
   142 
       
   143 firstname.content = inlines
       
   144 secondname.content = inlines
       
   145 lastname.content = inlines
       
   146 label.content = inlines
       
   147 
       
   148 # ~~~~~~ address
       
   149 address = element address { address.content }
       
   150 
       
   151 address.content = inlines
       
   152 
       
   153 # ~~~~~~ role
       
   154 role = element role { role.content }
       
   155 
       
   156 role.content = "author" | "illustrator" | "publisher" | "packager"
       
   157 
       
   158 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   159 
       
   160 place = element place { place.content }
       
   161 
       
   162 place.content = inlines
       
   163 
       
   164 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   165 
       
   166 # ~~~~~~ source
       
   167 source = element source {
       
   168    (  (attribute type { "book" }, source.content.book)
       
   169     | (attribute type { "file" }, source.content.file)),
       
   170    source.content
       
   171 }
       
   172 
       
   173 source.content.book =
       
   174    identifier.ean,
       
   175    title?,
       
   176    pagenumber*
       
   177 source.content.file =
       
   178    identifier.uri
       
   179 source.content =
       
   180    annotation*
       
   181 
       
   182 # ~~~~~~ pagenumber
       
   183 pagenumber = element pagenumber { pagenumber.attributes }
       
   184 
       
   185 pagenumber.attributes =
       
   186    pagenumber.value.attribute
       
   187 pagenumber.value.attribute = attribute value { xsd:positiveInteger }
       
   188 
       
   189 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   190 
       
   191 # ~~~~~~ keywordset
       
   192 keywordset = element keywordset { keywordset.content }
       
   193 
       
   194 keywordset.content = keyword+
       
   195 
       
   196 # ~~~~~~ keyword
       
   197 keyword = element keyword { keyword.content }
       
   198 
       
   199 keyword.content = mixed { sup*, sub* }
       
   200 
       
   201 # ~~~~~~ subjectset
       
   202 subjectset = element subjectset { subjectset.content }
       
   203 
       
   204 subjectset.content = subject+
       
   205 
       
   206 # ~~~~~~ subject
       
   207 subject = element subject { subject.attributes }
       
   208 
       
   209 subject.attributes =
       
   210    subject.id.attribute
       
   211 subject.id.attribute = attribute id { xsd:NMTOKEN }
       
   212 
       
   213 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   214 
       
   215 abstract = element abstract { abstract.content }
       
   216 
       
   217 abstract.content =
       
   218    p+
       
   219 
       
   220 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   221 
       
   222 cover = element cover { cover.content }
       
   223 
       
   224 cover.content =
       
   225    cover.image
       
   226 
       
   227 cover.image = element image { cover.image.attributes }
       
   228 
       
   229 cover.image.attributes =
       
   230    cover.image.id.attribute
       
   231 cover.image.id.attribute = attribute id { xsd:NMTOKEN }
       
   232 
       
   233 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   234 
       
   235 annotation = element annotation { annotation.content }
       
   236 
       
   237 annotation.content = inlines
       
   238 
       
   239 
       
   240 # =============================================================================
       
   241 #                                 DIVISION LEVEL
       
   242 # =============================================================================
       
   243 
       
   244 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   245 
       
   246 division = element division { division.content }
       
   247 
       
   248 division.content =
       
   249    division.head?,
       
   250    (division | topic)+
       
   251 
       
   252 
       
   253 # =============================================================================
       
   254 #                               COMPONENT LEVEL
       
   255 # =============================================================================
       
   256 
       
   257 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   258 
       
   259 topic = element topic { topic.attributes, topic.content }
       
   260 
       
   261 topic.attributes =
       
   262    topic.id.attribute?
       
   263  & topic.type.attribute?
       
   264  & lang.attribute?
       
   265 
       
   266 topic.content =
       
   267    component.head?,
       
   268    section+
       
   269 
       
   270 
       
   271 # =============================================================================
       
   272 #                                 SECTION LEVEL
       
   273 # =============================================================================
       
   274 
       
   275 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   276 
       
   277 section = element section { section.attributes, section.content }
       
   278 
       
   279 section.attributes =
       
   280    section.type.attribute?
       
   281  & lang.attribute?
       
   282 section.type.attribute = attribute type { xsd:NCName }
       
   283 
       
   284 section.content =
       
   285    section.head?,
       
   286    (section+ | block+)
       
   287 
       
   288 
       
   289 # =============================================================================
       
   290 #                                 BLOCK LEVEL
       
   291 # =============================================================================
       
   292 
       
   293 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   294 
       
   295 block = (p | speech | \list | blockquote | table | media)
       
   296 
   164 
   297 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   165 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   298 
   166 
   299 p = element p { p.content }
   167 p = element p { p.content }
   300 
   168 
   457 # ~~~~~~ audio
   325 # ~~~~~~ audio
   458 audio = element audio { audio.attributes }
   326 audio = element audio { audio.attributes }
   459 
   327 
   460 audio.attributes =
   328 audio.attributes =
   461    media.id.attribute
   329    media.id.attribute
       
   330 
       
   331 
       
   332 # =============================================================================
       
   333 #                                 HEAD LEVEL
       
   334 # =============================================================================
       
   335 
       
   336 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ title, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   337 
       
   338 title = element title { title.content }
       
   339 subtitle = element subtitle { title.content }
       
   340 
       
   341 title.content = inlines
       
   342 
       
   343 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   344 
       
   345 identifier.uri = element identifier {
       
   346    attribute type { "uri" }, xsd:anyURI
       
   347 }
       
   348 
       
   349 identifier.ean = element identifier {
       
   350    attribute type { "ean" }, xsd:token {pattern = "\d{13}"}
       
   351 }
       
   352 
       
   353 identifier = identifier.uri | identifier.ean
       
   354 
       
   355 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   356 
       
   357 copyright = element copyright { copyright.content }
       
   358 
       
   359 copyright.content = inlines
       
   360 
       
   361 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ contributors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   362 
       
   363 # ~~~~~~ contributors
       
   364 contributors = element contributors { contributors.content }
       
   365 
       
   366 contributors.content =
       
   367    contributor+
       
   368 
       
   369 # ~~~~~~ contributor
       
   370 contributor = element contributor { contributor.content }
       
   371 
       
   372 contributor.content =
       
   373    (((firstname, secondname?)?, lastname) | label),
       
   374    address?,
       
   375    link?,
       
   376    role*
       
   377 
       
   378 # ~~~~~~ firstname, secondname, lastname, label
       
   379 firstname = element firstname { firstname.content }
       
   380 secondname = element secondname { secondname.content }
       
   381 lastname = element lastname { lastname.content }
       
   382 label = element label { label.content }
       
   383 
       
   384 firstname.content = inlines
       
   385 secondname.content = inlines
       
   386 lastname.content = inlines
       
   387 label.content = inlines
       
   388 
       
   389 # ~~~~~~ address
       
   390 address = element address { address.content }
       
   391 
       
   392 address.content = inlines
       
   393 
       
   394 # ~~~~~~ role
       
   395 role = element role { role.content }
       
   396 
       
   397 role.content = "author" | "illustrator" | "publisher" | "packager"
       
   398 
       
   399 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   400 
       
   401 place = element place { place.content }
       
   402 
       
   403 place.content = inlines
       
   404 
       
   405 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   406 
       
   407 # ~~~~~~ source
       
   408 source = element source {
       
   409    (  (attribute type { "book" }, source.content.book)
       
   410     | (attribute type { "file" }, source.content.file)),
       
   411    source.content
       
   412 }
       
   413 
       
   414 source.content.book =
       
   415    identifier.ean,
       
   416    title?,
       
   417    pagenumber*
       
   418 source.content.file =
       
   419    identifier.uri
       
   420 source.content =
       
   421    annotation*
       
   422 
       
   423 # ~~~~~~ pagenumber
       
   424 pagenumber = element pagenumber { pagenumber.content }
       
   425 
       
   426 pagenumber.content = xsd:positiveInteger
       
   427 
       
   428 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   429 
       
   430 # ~~~~~~ keywordset
       
   431 keywordset = element keywordset { keywordset.content }
       
   432 
       
   433 keywordset.content = keyword+
       
   434 
       
   435 # ~~~~~~ keyword
       
   436 keyword = element keyword { keyword.content }
       
   437 
       
   438 keyword.content = mixed { sup*, sub* }
       
   439 
       
   440 # ~~~~~~ subjectset
       
   441 subjectset = element subjectset { subjectset.content }
       
   442 
       
   443 subjectset.content = subject+
       
   444 
       
   445 # ~~~~~~ subject
       
   446 subject = element subject { subject.attributes }
       
   447 
       
   448 subject.attributes =
       
   449    subject.id.attribute
       
   450 subject.id.attribute = attribute id { xsd:NMTOKEN }
       
   451 
       
   452 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   453 
       
   454 abstract = element abstract { abstract.content }
       
   455 
       
   456 abstract.content =
       
   457    p+
       
   458 
       
   459 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   460 
       
   461 cover = element cover { cover.content }
       
   462 
       
   463 cover.content =
       
   464    cover.image
       
   465 
       
   466 cover.image = element image { cover.image.attributes }
       
   467 
       
   468 cover.image.attributes =
       
   469    cover.image.id.attribute
       
   470 cover.image.id.attribute = attribute id { xsd:NMTOKEN }
       
   471 
       
   472 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   473 
       
   474 annotation = element annotation { annotation.content }
       
   475 
       
   476 annotation.content = inlines
   462 
   477 
   463 
   478 
   464 # =============================================================================
   479 # =============================================================================
   465 #                                 INLINE LEVEL
   480 #                                 INLINE LEVEL
   466 # =============================================================================
   481 # =============================================================================
   492 
   507 
   493 sub = element sub { text }
   508 sub = element sub { text }
   494 
   509 
   495 var = element var { text }
   510 var = element var { text }
   496 
   511 
       
   512 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   513 
       
   514 number = element number {
       
   515    ( attribute type {"roman"}, number.attributes, number.roman.content )
       
   516  | ( number.attributes, number.content)
       
   517 }
       
   518 
       
   519 number.attributes =
       
   520    number.value.attribute?
       
   521 number.value.attribute = attribute value { xsd:integer | xsd:decimal }
       
   522 
       
   523 number.content = mixed { sup* }
       
   524 number.roman.content = xsd:token {pattern = "[dlxvi]+"}
       
   525 
   497 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ math ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   526 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ math ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   498 
   527 
   499 math = element math {
   528 math = element math {
   500    ( attribute notation {"tex"}, math.attributes, math.tex.content )
   529    ( attribute notation {"tex"}, math.attributes, math.tex.content )
   501  | ( math.attributes, math.content)
   530  | ( math.attributes, math.content)
   505    wide.attribute?
   534    wide.attribute?
   506 wide.attribute = attribute wide { xsd:boolean }
   535 wide.attribute = attribute wide { xsd:boolean }
   507 
   536 
   508 math.content = mixed { sup* & sub* & var* }
   537 math.content = mixed { sup* & sub* & var* }
   509 math.tex.content = text
   538 math.tex.content = text
   510 
       
   511 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   512 
       
   513 number = element number {
       
   514    ( attribute type {"roman"}, number.attributes, number.roman.content )
       
   515  | ( number.attributes, number.content)
       
   516 }
       
   517 
       
   518 number.attributes =
       
   519    number.value.attribute?
       
   520 number.value.attribute = attribute value { xsd:integer | xsd:decimal }
       
   521 
       
   522 number.content = mixed { sup* }
       
   523 number.roman.content = xsd:token {pattern = "[dlxvi]+"}
       
   524 
   539 
   525 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   540 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   526 
   541 
   527 date = element date { date.attributes, date.content }
   542 date = element date { date.attributes, date.content }
   528 
   543