RelaxNG/publidoc.rnc
changeset 9 1efd69b7c90e
parent 8 1d4ee28efd68
child 11 2b32b535705c
equal deleted inserted replaced
8:1d4ee28efd68 9:1efd69b7c90e
   203 
   203 
   204 section = element section { section.content, section.attributes }
   204 section = element section { section.content, section.attributes }
   205 
   205 
   206 section.content =
   206 section.content =
   207    metadata?,
   207    metadata?,
   208    (section+
   208    (section+ | block+)
   209     | (parag | media | speech)+)
       
   210 
   209 
   211 section.attributes =
   210 section.attributes =
   212    status.attribute?
   211    status.attribute?
   213 status.attribute = attribute status { xsd:NCName }
   212 status.attribute = attribute status { xsd:NCName }
   214 
   213 
   215 
   214 
   216 # =============================================================================
   215 # =============================================================================
   217 #                                 Block level
   216 #                                 Block level
   218 # =============================================================================
   217 # =============================================================================
   219 
   218 
   220 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ parag ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   219 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blocks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   220 
       
   221 block = (parag | \list | media | speech)
       
   222 
       
   223 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ parag ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   221 
   224 
   222 parag = element parag { parag.content }
   225 parag = element parag { parag.content }
   223 
   226 
   224 parag.content =
   227 parag.content =
   225    inlines
   228    inlines
   226  & link*
   229  & link*
       
   230 
       
   231 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   232 
       
   233 # ~~~~~~ list
       
   234 \list = element list { \list.content }
       
   235 
       
   236 \list.content =
       
   237    title?,
       
   238    (  (attribute type {"ordered"} ?, item, item+)
       
   239     | (attribute type {"itemized"}, item, item+)
       
   240     | (attribute type {"glossary"}, glossary.item+) )
       
   241 
       
   242 # ~~~~~~ item
       
   243 item = element item { item.content }
       
   244 
       
   245 item.content = block+
       
   246 
       
   247 # ~~~~~~ glossary.item
       
   248 glossary.item = element item { glossary.item.content }
       
   249 
       
   250 glossary.item.content =
       
   251    label,
       
   252    block+
       
   253 
       
   254 # ~~~~~~ label
       
   255 label = element label { label.content }
       
   256 
       
   257 label.content = inlines
   227 
   258 
   228 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   259 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   229 
   260 
   230 # ~~~~~~ media
   261 # ~~~~~~ media
   231 media = element media { media.content }
   262 media = element media { media.content }
   344 
   375 
   345 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   376 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   346 
   377 
   347 foreign = element foreign { foreign.attributes, foreign.content }
   378 foreign = element foreign { foreign.attributes, foreign.content }
   348 
   379 
   349 foreign.attributes = lang.attribute?
   380 foreign.attributes =
       
   381    lang.attribute?
   350 
   382 
   351 foreign.content = inlines
   383 foreign.content = inlines
   352 
   384 
   353 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ highlight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   385 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ highlight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   354 
   386 
   382 
   414 
   383 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   415 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   384 
   416 
   385 link = element link { link.attributes, link.content }
   417 link = element link { link.attributes, link.content }
   386 
   418 
   387 link.attributes = empty
   419 link.attributes =
       
   420    (uri.attribute | idref.attribute)?
       
   421 uri.attribute = attribute uri { xsd:anyURI }
       
   422 idref.attribute = attribute idref { xsd:IDREF }
   388 
   423 
   389 link.content = inlines
   424 link.content = inlines