RelaxNG/publidoc.rnc
changeset 191 e50ac13ec921
parent 190 546609a92447
child 199 d4c92312bc71
equal deleted inserted replaced
190:546609a92447 191:e50ac13ec921
   118 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   118 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   119 
   119 
   120 topic = element topic { topic.attributes, topic.content }
   120 topic = element topic { topic.attributes, topic.content }
   121 
   121 
   122 topic.attributes =
   122 topic.attributes =
   123    (topic.id.attribute | topic.xmlid.attribute)?
   123    (topic.id.attribute | xmlid.attribute)?
   124  & topic.type.attribute?
   124  & topic.type.attribute?
   125  & lang.attribute?
   125  & lang.attribute?
   126 topic.xmlid.attribute = attribute xml:id { xsd:ID }
   126 xmlid.attribute = attribute xml:id { xsd:ID }
   127 
   127 
   128 topic.content =
   128 topic.content =
   129    component.head?,
   129    component.head?,
   130    header?,
   130    header?,
   131    ((section+, bibliography?) | bibliography),
   131    ((section+, bibliography?) | bibliography),
   345    media.caption?,
   345    media.caption?,
   346    link?
   346    link?
   347 
   347 
   348 # ~~~~~~ image
   348 # ~~~~~~ image
   349 image = element image { image.attributes, image.content }
   349 image = element image { image.attributes, image.content }
       
   350 hotspot.image = element image {image.attributes }
   350 
   351 
   351 image.attributes =
   352 image.attributes =
   352    media.id.attribute
   353    media.id.attribute
   353  & image.type?
   354  & image.type?
   354 media.id.attribute = attribute id { xsd:NMTOKEN }
   355 media.id.attribute = attribute id { xsd:NMTOKEN }
   378 hotspot.attributes =
   379 hotspot.attributes =
   379    x.attribute
   380    x.attribute
   380  & y.attribute
   381  & y.attribute
   381  & w.attribute
   382  & w.attribute
   382  & h.attribute?
   383  & h.attribute?
   383  & (hotspot.type.attribute
   384  & hotspot.type.attribute?
   384   & dx.attribute?
   385  & xmlid.attribute?
   385   & dy.attribute?
       
   386   & dw.attribute?
       
   387   & dh.attribute?)?
       
   388 x.attribute = attribute x { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   386 x.attribute = attribute x { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   389 y.attribute = attribute y { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   387 y.attribute = attribute y { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   390 w.attribute = attribute w { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   388 w.attribute = attribute w { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   391 h.attribute = attribute h { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   389 h.attribute = attribute h { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   392 hotspot.type.attribute = attribute type { "normal" | "visible" | "pulse" }
   390 hotspot.type.attribute = attribute type { "normal" | "visible" | "pulse" }
       
   391    
       
   392 hotspot.content =
       
   393    ((link | p+ | hotspot.image | audio | video), (spot, scenario?)?)
       
   394  | (spot, scenario?)
       
   395    
       
   396 # ~~~~~~ spot
       
   397 spot = element spot { spot.attributes, spot.content }
       
   398 
       
   399 spot.attributes =
       
   400    dx.attribute?
       
   401  & dy.attribute?
       
   402  & dw.attribute?
       
   403  & dh.attribute?
   393 dx.attribute = attribute dx { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   404 dx.attribute = attribute dx { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   394 dy.attribute = attribute dy { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   405 dy.attribute = attribute dy { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   395 dw.attribute = attribute dw { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   406 dw.attribute = attribute dw { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   396 dh.attribute = attribute dh { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} }
   407 dh.attribute = attribute dh { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} }
   397    
   408 
   398 hotspot.content =
   409 spot.content =
   399    (p | link | image | audio | video),
   410    ((p+ | image), audio?)
   400    scenario?
   411  | audio
   401    
   412  | video
       
   413 
   402 # ~~~~~~ media.caption
   414 # ~~~~~~ media.caption
   403 media.caption = element caption { caption.attributes, caption.content }
   415 media.caption = element caption { caption.attributes, caption.content }
   404 
   416 
   405 caption.attributes =
   417 caption.attributes =
   406    x.attribute?
   418    x.attribute?
   407  & y.attribute?
   419  & y.attribute?
       
   420 
       
   421 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scenario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   422 
       
   423 # ~~~~~~ scenario
       
   424 scenario = element scenario { scenario.content }
       
   425 
       
   426 scenario.content =
       
   427    init*,
       
   428    onclick*
       
   429 
       
   430 # ~~~~~~ init
       
   431 init = element init { init.attributes }
       
   432 
       
   433 init.attributes =
       
   434    init.action.attribute
       
   435  & target.attribute?
       
   436 init.action.attribute = attribute action { "hide" }
       
   437 target.attribute = attribute target { "hotspot" | "spot" }
       
   438 
       
   439 # ~~~~~~ onclick
       
   440 onclick = element onclick { onclick.attributes }
       
   441 
       
   442 onclick.attributes =
       
   443    onclick.action.attribute
       
   444  & target.attribute?
       
   445 onclick.action.attribute = attribute action { "show" }
   408 
   446 
   409 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliograpgy.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   447 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliograpgy.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   410 
   448 
   411 # ~~~~~~ bibliography.entry
   449 # ~~~~~~ bibliography.entry
   412 bibliography.entry = element entry { bibliography.entry.content }
   450 bibliography.entry = element entry { bibliography.entry.content }
   430 
   468 
   431 # ~~~~~~ pages
   469 # ~~~~~~ pages
   432 pages = element pages { pages.content }
   470 pages = element pages { pages.content }
   433 
   471 
   434 pages.content = xsd:positiveInteger
   472 pages.content = xsd:positiveInteger
   435 
       
   436 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scenario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       
   437 
       
   438 # ~~~~~~ scenario
       
   439 scenario = element scenario { scenario.content }
       
   440 
       
   441 scenario.content =
       
   442    init*,
       
   443    onclick*
       
   444 
       
   445 # ~~~~~~ init
       
   446 init = element init { init.attributes }
       
   447 
       
   448 init.attributes =
       
   449    init.action.attribute
       
   450 init.action.attribute = attribute action { "hide" }
       
   451 
       
   452 # ~~~~~~ onclick
       
   453 onclick = element onclick { onclick.attributes }
       
   454 
       
   455 onclick.attributes =
       
   456    onclick.action.attribute
       
   457 onclick.action.attribute = attribute action { "show" }
       
   458 
   473 
   459 
   474 
   460 # =============================================================================
   475 # =============================================================================
   461 #                                 HEAD LEVEL
   476 #                                 HEAD LEVEL
   462 # =============================================================================
   477 # =============================================================================