RelaxNG/publidoc.rnc
changeset 13 846ec40a5b2d
parent 11 2b32b535705c
child 17 ca367d4d080b
equal deleted inserted replaced
12:2885b2c3ff59 13:846ec40a5b2d
   233 # ~~~~~~ list
   233 # ~~~~~~ list
   234 \list = element list { \list.content }
   234 \list = element list { \list.content }
   235 
   235 
   236 \list.content =
   236 \list.content =
   237    title?,
   237    title?,
   238    (  (attribute type {"itemized"} ?, item, item+)
   238    (  (attribute type {"ordered"} ?, item, item+)
   239     | (attribute type {"ordered"}, item, item+)
       
   240     | (attribute type {"glossary"}, glossary.item+) )
   239     | (attribute type {"glossary"}, glossary.item+) )
   241 
   240 
   242 # ~~~~~~ item
   241 # ~~~~~~ item
   243 item = element item { item.content }
   242 item = element item { item.content }
   244 
   243 
   254 # ~~~~~~ label
   253 # ~~~~~~ label
   255 label = element label { label.content }
   254 label = element label { label.content }
   256 
   255 
   257 label.content = inlines
   256 label.content = inlines
   258 
   257 
   259 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   258 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   260 
   259 
   261 # ~~~~~~ speech
   260 # ~~~~~~ speech
   262 speech = element speech { speech.content }
   261 speech = element speech { speech.content }
   263 
   262 
   264 speech.content =
   263 speech.content =
   315 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   314 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   316 
   315 
   317 inlines = mixed {
   316 inlines = mixed {
   318    sup*
   317    sup*
   319  & sub*
   318  & sub*
   320  & romannum*
   319  & number*
   321  & date*
   320  & date*
   322  & name*
   321  & name*
   323  & note*
   322  & note*
   324  & foreign*
   323  & foreign*
   325  & highlight*
   324  & highlight*
   333 
   332 
   334 sup = element sup { inlines }
   333 sup = element sup { inlines }
   335 
   334 
   336 sub = element sub { inlines }
   335 sub = element sub { inlines }
   337 
   336 
   338 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ romannum ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   337 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   339 
   338 
   340 romannum = element romannum { xsd:token {pattern = "([dlxvi]+)"} }
   339 number = element number {
       
   340    ( attribute type {"roman"}, number.attributes, number.roman.content )
       
   341  | ( number.attributes, number.content)
       
   342 }
       
   343 
       
   344 number.attributes =
       
   345    number.value.attribute?
       
   346 number.value.attribute = attribute value { xsd:integer | xsd:decimal }
       
   347 
       
   348 number.content = mixed { sup* }
       
   349 number.roman.content = xsd:token {pattern = "[dlxvi]+"}
   341 
   350 
   342 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   351 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   343 
   352 
   344 date = element date { date.attributes, date.content }
   353 date = element date { date.attributes, date.content }
   345 
   354 
   346 date.attributes =
   355 date.attributes =
   347    date.of.attribute?
   356    date.value.attribute
       
   357  & date.of.attribute?
       
   358 date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear }
   348 date.of.attribute = attribute of { date.of.enumeration }
   359 date.of.attribute = attribute of { date.of.enumeration }
   349 date.of.enumeration = "event" | "birth" | "death"
   360 date.of.enumeration = "birth" | "death"
   350 
   361 
   351 date.content = xsd:date | xsd:gYearMonth | xsd:gYear
   362 date.content = mixed { sup* }
   352 
   363 
   353 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   364 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   354 
   365 
   355 name = element name { name.attributes, name.content }
   366 name = element name { name.attributes, name.content }
   356 
   367 
   370 note.label.attribute = attribute label { text }
   381 note.label.attribute = attribute label { text }
   371 
   382 
   372 note.content =
   383 note.content =
   373    parag+
   384    parag+
   374 
   385 
   375 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   386 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   376 
   387 
   377 foreign = element foreign { foreign.attributes, foreign.content }
   388 foreign = element foreign { foreign.attributes, foreign.content }
   378 
   389 
   379 foreign.attributes =
   390 foreign.attributes =
   380    lang.attribute?
   391    lang.attribute?