RelaxNG/publidoc.rnc
changeset 248 b62d4097845e
parent 246 430c1f46b074
child 252 5540389e60ba
equal deleted inserted replaced
247:120194e150ed 248:b62d4097845e
   202 # =============================================================================
   202 # =============================================================================
   203 
   203 
   204 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   204 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   205 
   205 
   206 # ~~~~~~ block
   206 # ~~~~~~ block
   207 block = (p | speech | \list | blockquote | table | media)
   207 block = (p | speech | \list | blockquote | table | table.cals | media)
   208 
   208 
   209 # ~~~~~~ block.head
   209 # ~~~~~~ block.head
   210 block.head = element head { block.head.content }
   210 block.head = element head { block.head.content }
   211 
   211 
   212 block.head.content =
   212 block.head.content =
   272 
   272 
   273 attribution.content = mixed {
   273 attribution.content = mixed {
   274    sup* & number* & date* & name* & foreign* & acronym* & term* & literal*
   274    sup* & number* & date* & name* & foreign* & acronym* & term* & literal*
   275  & highlight* & emphasis* & mentioned* & note* & warning* }
   275  & highlight* & emphasis* & mentioned* & note* & warning* }
   276 
   276 
   277 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   277 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   278 
   278 
   279 # ~~~~~~ table
   279 # ~~~~~~ table
   280 table = element table { table.content }
   280 table = element table { table.attributes, table.content }
       
   281 
       
   282 table.attributes =
       
   283    table.type.attribute?
       
   284 table.type.attribute = attribute type { xsd:NCName }
   281 
   285 
   282 table.content =
   286 table.content =
       
   287    block.head?,
       
   288    thead?,
       
   289    (tbody+ | tr+),
       
   290    table.caption?
       
   291 
       
   292 # ~~~~~~ thead, tbody
       
   293 thead = element thead { thead.content }
       
   294 tbody = element tbody { tbody.content }
       
   295 
       
   296 thead.content =
       
   297    tr+
       
   298 tbody.content =
       
   299    tr+
       
   300 
       
   301 # ~~~~~~ tr
       
   302 tr = element tr { tr.attributes, tr.content }
       
   303 
       
   304 tr.attributes =
       
   305    align.attribute?
       
   306  & valign.attribute?
       
   307 align.attribute = attribute align { "left"  |  "right"  | "center" | "justify" }
       
   308 valign.attribute = attribute valign { "top" | "middle" | "bottom" }
       
   309 
       
   310 tr.content =
       
   311    (td | th)+
       
   312 
       
   313 # ~~~~~~ td, th
       
   314 td = element td { td.attributes, td.content }
       
   315 th = element th { td.attributes, td.content }
       
   316 
       
   317 td.attributes =
       
   318    align.attribute?
       
   319  & valign.attribute?
       
   320  & colspan.attribute?
       
   321  & rowspan.attribute?
       
   322 colspan.attribute = attribute colspan { xsd:positiveInteger }
       
   323 rowspan.attribute = attribute rowspan { xsd:positiveInteger }
       
   324 
       
   325 td.content =
       
   326    inlines
       
   327  | (p | media)+
       
   328 
       
   329 # ~~~~~~ table.caption
       
   330 table.caption = element caption { caption.content }
       
   331 
       
   332 caption.content =
       
   333    inlines
       
   334  | (p | speech | \list | blockquote)+
       
   335 
       
   336 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table.cals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   337 
       
   338 # ~~~~~~ table.cals
       
   339 table.cals = element table { table.attributes, table.cals.content }
       
   340 
       
   341 table.cals.content =
   283    block.head?,
   342    block.head?,
   284    tgroup+,
   343    tgroup+,
   285    table.caption?
   344    table.caption?
   286 
   345 
   287 # ~~~~~~ tgroup
   346 # ~~~~~~ tgroup
   288 tgroup = element tgroup { tgroup.attributes, tgroup.content }
   347 tgroup = element tgroup { tgroup.attributes, tgroup.content }
   289 
   348 
   290 tgroup.content =
       
   291    thead?,
       
   292    tbody
       
   293 
       
   294 tgroup.attributes =
   349 tgroup.attributes =
   295    cols.attribute
   350    cols.attribute
   296  & align.attribute?
       
   297  & colsep.attribute?
       
   298  & rowsep.attribute?
       
   299 cols.attribute = attribute cols { xsd:positiveInteger }
   351 cols.attribute = attribute cols { xsd:positiveInteger }
   300 align.attribute = attribute align { "left"  |  "right"  | "center" | "justify" }
   352 
   301 colsep.attribute = attribute colsep { "0" | "1" }
   353 tgroup.content =
   302 rowsep.attribute = attribute rowsep { "0" | "1" }
   354    thead.cals?,
       
   355    tbody.cals
   303 
   356 
   304 # ~~~~~~ thead, tbody
   357 # ~~~~~~ thead, tbody
   305 thead = element thead { thead.attributes, thead.content }
   358 thead.cals = element thead { thead.cals.content }
   306 tbody = element tbody { tbody.attributes, tbody.content }
   359 tbody.cals = element tbody { tbody.cals.content }
   307 
   360 
   308 thead.attributes =
   361 thead.cals.content =
   309    valign.attribute?
       
   310 tbody.attributes =
       
   311    valign.attribute?
       
   312 valign.attribute = attribute valign { "top" | "middle" | "bottom" }
       
   313 
       
   314 thead.content =
       
   315    row+
   362    row+
   316 tbody.content =
   363 tbody.cals.content =
   317    row+
   364    row+
   318 
   365 
   319 # ~~~~~~ row
   366 # ~~~~~~ row
   320 row = element row { row.attributes, row.content }
   367 row = element row { row.attributes, row.content }
   321 
   368 
   322 row.attributes =
   369 row.attributes =
   323    valign.attribute?
   370    valign.attribute?
   324  & rowsep.attribute?
       
   325 
   371 
   326 row.content =
   372 row.content =
   327   table.entry+
   373   table.cals.entry+
   328 
   374 
   329 # ~~~~~~ table.entry
   375 # ~~~~~~ table.cals.entry
   330 table.entry = element entry { table.entry.attributes, table.entry.content }
   376 table.cals.entry = element entry {
   331 
   377    table.cals.entry.attributes, table.cals.entry.content }
   332 table.entry.attributes =
   378 
       
   379 table.cals.entry.attributes =
   333    align.attribute?
   380    align.attribute?
   334  & valign.attribute?
   381  & valign.attribute?
   335  & colsep.attribute?
   382 
   336  & rowsep.attribute?
   383 table.cals.entry.content =
   337 
       
   338 table.entry.content =
       
   339    inlines
   384    inlines
   340  | (p | media)+
   385  | (p | media)+
   341 
       
   342 # ~~~~~~ table.caption
       
   343 table.caption = element caption { caption.content }
       
   344 
       
   345 caption.content =
       
   346    inlines
       
   347  | (p | speech | \list | blockquote)+
       
   348 
   386 
   349 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   387 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   350 
   388 
   351 # ~~~~~~ media
   389 # ~~~~~~ media
   352 media = element media { media.attributes, media.content }
   390 media = element media { media.attributes, media.content }