patrick@0: # $Id$ patrick@0: patrick@0: start = publidoc patrick@0: patrick@0: patrick@0: publidoc = element publidoc { patrick@0: publidoc.attributes, patrick@0: publidoc.content patrick@0: } patrick@0: patrick@0: publidoc.attributes = patrick@0: version.attribute patrick@0: version.attribute = attribute version { "1.0" } patrick@0: patrick@0: publidoc.content = patrick@0: document patrick@0: | top.topic patrick@0: patrick@0: patrick@0: # ============================================================================= Patrick@310: # HEAD LEVEL Patrick@310: # ============================================================================= Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~ title, shorttitle, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: title = element title { title.content } Patrick@310: shorttitle = element shorttitle { title.content } Patrick@310: subtitle = element subtitle { title.content } Patrick@310: Patrick@310: title.content = inlines Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: # ~~~~~~ identifier Patrick@310: identifier = element identifier { Patrick@310: (attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"}) Patrick@310: | (attribute type { "uri" }, for.attribute?, xsd:anyURI) Patrick@310: } Patrick@310: Patrick@310: # ~~~~~~ identifier.ean Patrick@310: identifier.ean = element identifier { Patrick@310: attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"} Patrick@310: } Patrick@310: Patrick@310: # ~~~~~~ identifier.uri Patrick@310: identifier.uri = element identifier { Patrick@310: attribute type { "uri" }, for.attribute?, xsd:anyURI Patrick@310: } Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: copyright = element copyright { copyright.content } Patrick@310: Patrick@310: copyright.content = simple.inlines Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ collection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: collection = element collection { collection.content } Patrick@310: Patrick@310: collection.content = simple.inlines Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ contributors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: # ~~~~~~ contributors Patrick@310: contributors = element contributors { contributors.content } Patrick@310: Patrick@310: contributors.content = Patrick@310: contributor+ Patrick@310: Patrick@310: # ~~~~~~ contributor Patrick@310: contributor = element contributor { contributor.content } Patrick@310: Patrick@310: contributor.content = Patrick@310: identifier.uri?, Patrick@350: ((firstname?, lastname) | label), Patrick@310: address?, Patrick@310: link?, Patrick@310: role+ Patrick@310: Patrick@310: # ~~~~~~ firstname, secondname, lastname, label Patrick@310: firstname = element firstname { firstname.content } Patrick@310: lastname = element lastname { lastname.content } Patrick@310: label = element label { label.content } Patrick@310: Patrick@310: firstname.content = simple.inlines Patrick@310: lastname.content = simple.inlines Patrick@310: label.content = simple.inlines Patrick@310: Patrick@310: # ~~~~~~ address Patrick@310: address = element address { address.content } Patrick@310: Patrick@310: address.content = simple.inlines Patrick@310: Patrick@310: # ~~~~~~ role Patrick@310: role = element role { role.content } Patrick@310: Patrick@310: role.content = "author" | "illustrator" | "publisher" | "packager" Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: place = element place { place.content } Patrick@310: Patrick@310: place.content = simple.inlines Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: source = element source { Patrick@310: ( (attribute type { "book" }, bibliography.entry.content) Patrick@310: | (attribute type { "file" }, source.content.file)), Patrick@310: source.content Patrick@310: } Patrick@310: Patrick@310: source.content.file = Patrick@310: identifier.uri Patrick@310: source.content = Patrick@364: annotation? Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: # ~~~~~~ keywordset Patrick@310: keywordset = element keywordset { keywordset.content } Patrick@310: Patrick@310: keywordset.content = keyword+ Patrick@310: Patrick@310: # ~~~~~~ keyword Patrick@310: keyword = element keyword { keyword.content } Patrick@310: Patrick@310: keyword.content = simple.inlines Patrick@310: Patrick@310: # ~~~~~~ subjectset Patrick@310: subjectset = element subjectset { subjectset.content } Patrick@310: Patrick@310: subjectset.content = subject+ Patrick@310: Patrick@310: # ~~~~~~ subject Patrick@310: subject = element subject { subject.content } Patrick@310: Patrick@310: subject.content = simple.inlines Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ index ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@355: # ~~~~~~ indexset Patrick@355: indexset = element indexset { indexset.content } Patrick@355: Patrick@355: indexset.content = head.index+ Patrick@355: Patrick@310: # ~~~~~~ index Patrick@310: index = element index { index.content } Patrick@310: head.index = element index { head.index.content } Patrick@310: Patrick@310: index.content = Patrick@310: (index.w, index.entry?) Patrick@310: | (index.entry, (index.w | index.entry)?) Patrick@310: head.index.content = Patrick@310: index.entry, index.entry? Patrick@310: Patrick@310: # ~~~~~~ index.w Patrick@310: index.w = element w { simple.inlines } Patrick@310: Patrick@310: # ~~~~~~ index.entry Patrick@310: index.entry = element entry { simple.inlines } Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: abstract = element abstract { abstract.content } Patrick@310: Patrick@310: abstract.content = Patrick@310: p+ Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: cover = element cover { cover.content } Patrick@310: Patrick@310: cover.content = Patrick@310: cover.image Patrick@310: Patrick@310: cover.image = element image { cover.image.attributes } Patrick@310: Patrick@310: cover.image.attributes = Patrick@310: media.id.attribute Patrick@310: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: annotation = element annotation { annotation.content } Patrick@310: Patrick@364: annotation.content = Patrick@364: inlines | p+ Patrick@310: Patrick@310: Patrick@310: # ============================================================================= patrick@20: # TOP LEVEL patrick@0: # ============================================================================= patrick@0: patrick@98: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: top.head = element head { top.head.content } patrick@90: patrick@90: top.head.content = Patrick@384: (title & shorttitle? & subtitle*)? Patrick@256: & identifier* patrick@181: & copyright* Patrick@155: & collection? patrick@90: & contributors? patrick@90: & date? patrick@90: & place? patrick@156: & (source, source?)? patrick@90: & keywordset? patrick@90: & subjectset? Patrick@355: & indexset? patrick@90: & abstract? patrick@90: & cover? Patrick@364: & annotation? patrick@90: patrick@0: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@0: document = element document { document.attributes, document.content } patrick@0: patrick@0: document.attributes = Patrick@388: document.id.attribute? patrick@142: & document.type.attribute? patrick@66: & lang.attribute? patrick@117: document.id.attribute = attribute id { xsd:NMTOKEN } patrick@142: document.type.attribute = attribute type { xsd:NCName } patrick@66: lang.attribute = attribute xml:lang { xsd:language } patrick@0: patrick@0: document.content = patrick@20: top.head?, patrick@56: (division | topic)+ patrick@0: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@18: top.topic = element topic { top.topic.attributes, top.topic.content } patrick@0: patrick@20: top.topic.attributes = Patrick@388: topic.id.attribute? patrick@20: & topic.type.attribute? patrick@66: & lang.attribute? patrick@117: topic.id.attribute = attribute id { xsd:NMTOKEN } patrick@20: topic.type.attribute = attribute type { xsd:NCName } patrick@20: patrick@20: top.topic.content = patrick@20: top.head?, Patrick@137: header?, Patrick@190: ((section+, bibliography?) | bibliography), Patrick@137: footer? patrick@0: patrick@40: patrick@0: # ============================================================================= patrick@20: # DIVISION LEVEL patrick@0: # ============================================================================= patrick@0: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: division.head = element head { division.head.content } Patrick@310: Patrick@310: division.head.content = Patrick@384: (title & shorttitle? & subtitle*)? Patrick@355: & indexset? Patrick@310: & abstract? Patrick@364: & annotation? Patrick@310: patrick@70: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: Patrick@232: division = element division { division.attributes, division.content } Patrick@232: Patrick@232: division.attributes = Patrick@232: division.type.attribute? Patrick@232: division.type.attribute = attribute type { xsd:NCName } patrick@0: patrick@0: division.content = patrick@20: division.head?, Patrick@217: front?, patrick@56: (division | topic)+ patrick@0: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ front ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: Patrick@217: front = element front { front.content } Patrick@217: Patrick@217: front.content = Patrick@217: section+ Patrick@217: patrick@0: patrick@0: # ============================================================================= patrick@90: # COMPONENT LEVEL patrick@0: # ============================================================================= patrick@0: patrick@90: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ component.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: component.head = element head { component.head.content } patrick@90: patrick@90: component.head.content = Patrick@384: (title & shorttitle? & subtitle*)? patrick@90: & contributors? patrick@143: & date? patrick@143: & place? patrick@143: & keywordset? patrick@143: & subjectset? Patrick@355: & indexset? patrick@90: & abstract? Patrick@364: & annotation? patrick@90: patrick@0: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@0: topic = element topic { topic.attributes, topic.content } patrick@0: patrick@0: topic.attributes = Patrick@191: (topic.id.attribute | xmlid.attribute)? patrick@0: & topic.type.attribute? patrick@69: & lang.attribute? Patrick@191: xmlid.attribute = attribute xml:id { xsd:ID } patrick@0: patrick@0: topic.content = patrick@20: component.head?, Patrick@137: header?, Patrick@190: ((section+, bibliography?) | bibliography), Patrick@137: footer? patrick@0: patrick@0: patrick@0: # ============================================================================= patrick@20: # SECTION LEVEL patrick@0: # ============================================================================= patrick@0: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@310: section.head = element head { section.head.content } Patrick@310: Patrick@310: section.head.content = Patrick@384: (title & shorttitle? & subtitle*)? Patrick@310: & keywordset? Patrick@310: & subjectset? Patrick@355: & indexset? Patrick@310: & abstract? Patrick@310: & audio* Patrick@364: & annotation? Patrick@310: Patrick@137: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@137: Patrick@137: header = element header { header.content } Patrick@137: Patrick@137: header.content = Patrick@137: block+ Patrick@137: patrick@20: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@58: section = element section { section.attributes, section.content } patrick@58: patrick@58: section.attributes = Patrick@279: xmlid.attribute? Patrick@279: & section.type.attribute? patrick@64: & lang.attribute? patrick@166: & for.attribute? patrick@58: section.type.attribute = attribute type { xsd:NCName } patrick@166: for.attribute = attribute for { xsd:NCName } patrick@0: patrick@0: section.content = patrick@20: section.head?, patrick@9: (section+ | block+) patrick@0: Patrick@189: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@189: Patrick@189: bibliography = element bibliography { bibliography.content } Patrick@189: Patrick@189: bibliography.content = Patrick@189: bibliography.entry+ Patrick@189: Patrick@137: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@137: Patrick@137: footer = element footer { footer.content } Patrick@137: Patrick@137: footer.content = Patrick@137: block+ Patrick@137: patrick@0: patrick@0: # ============================================================================= patrick@20: # BLOCK LEVEL patrick@0: # ============================================================================= patrick@0: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@9: patrick@90: block.head = element head { block.head.content } patrick@90: patrick@90: block.head.content = Patrick@384: (title & shorttitle? & subtitle*)? Patrick@355: & indexset? Patrick@364: & annotation? patrick@90: Patrick@310: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@310: Patrick@313: block = (p | \list | blockquote | speech | table | table.cals | media) Patrick@310: patrick@42: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@20: p = element p { p.content } patrick@0: patrick@20: p.content = patrick@0: inlines patrick@0: patrick@17: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@9: patrick@9: # ~~~~~~ list patrick@75: \list = element list { patrick@20: block.head?, patrick@71: ( (attribute type {"ordered"}?, item, item+) patrick@9: | (attribute type {"glossary"}, glossary.item+) ) patrick@75: } patrick@9: patrick@9: # ~~~~~~ item patrick@9: item = element item { item.content } patrick@9: patrick@30: item.content = patrick@73: inlines patrick@73: | block+ patrick@9: patrick@9: # ~~~~~~ glossary.item patrick@9: glossary.item = element item { glossary.item.content } patrick@9: patrick@9: glossary.item.content = patrick@9: label, patrick@9: block+ patrick@9: patrick@44: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@44: patrick@44: # ~~~~~~ blockquote Patrick@306: blockquote = element blockquote { blockquote.attributes, blockquote.content } patrick@44: Patrick@306: blockquote.attributes = Patrick@306: blockquote.type.attribute? Patrick@306: blockquote.type.attribute = attribute type { xsd:NCName } Patrick@310: patrick@44: blockquote.content = patrick@44: block.head?, patrick@44: (p | speech | \list)+, patrick@44: attribution? patrick@44: patrick@44: # ~~~~~~ attribution patrick@72: attribution = element attribution { attribution.content } patrick@44: Patrick@225: attribution.content = mixed { Patrick@225: sup* & number* & date* & name* & foreign* & acronym* & term* & literal* Patrick@238: & highlight* & emphasis* & mentioned* & note* & warning* } patrick@44: Patrick@313: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@313: Patrick@313: # ~~~~~~ speech Patrick@313: speech = element speech { speech.content } Patrick@313: Patrick@313: speech.content = Patrick@313: speaker?, Patrick@313: stage?, Patrick@313: (p | blockquote)+ Patrick@313: Patrick@313: # ~~~~~~ speaker Patrick@313: speaker = element speaker { speaker.content } Patrick@313: Patrick@313: speaker.content = inlines Patrick@313: patrick@248: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@17: patrick@73: # ~~~~~~ table patrick@248: table = element table { table.attributes, table.content } patrick@248: patrick@248: table.attributes = patrick@248: table.type.attribute? patrick@248: table.type.attribute = attribute type { xsd:NCName } patrick@17: patrick@17: table.content = patrick@20: block.head?, Patrick@358: ((thead?, tbody+) | tr+), patrick@109: table.caption? patrick@17: patrick@248: # ~~~~~~ thead, tbody patrick@248: thead = element thead { thead.content } patrick@248: tbody = element tbody { tbody.content } patrick@17: patrick@248: thead.content = patrick@248: tr+ patrick@248: tbody.content = patrick@248: tr+ patrick@17: patrick@248: # ~~~~~~ tr patrick@248: tr = element tr { tr.attributes, tr.content } patrick@248: patrick@248: tr.attributes = patrick@248: align.attribute? patrick@248: & valign.attribute? Tiphanie@309: & cell.type.attribute? patrick@17: align.attribute = attribute align { "left" | "right" | "center" | "justify" } patrick@22: valign.attribute = attribute valign { "top" | "middle" | "bottom" } Tiphanie@309: cell.type.attribute = attribute type { xsd:NCName } patrick@75: patrick@248: tr.content = patrick@248: (td | th)+ patrick@17: patrick@248: # ~~~~~~ td, th patrick@248: td = element td { td.attributes, td.content } patrick@248: th = element th { td.attributes, td.content } patrick@17: patrick@248: td.attributes = patrick@146: align.attribute? patrick@146: & valign.attribute? patrick@248: & colspan.attribute? patrick@248: & rowspan.attribute? Tiphanie@309: & cell.type.attribute? patrick@248: colspan.attribute = attribute colspan { xsd:positiveInteger } patrick@248: rowspan.attribute = attribute rowspan { xsd:positiveInteger } patrick@17: patrick@248: td.content = patrick@17: inlines patrick@37: | (p | media)+ patrick@17: patrick@109: # ~~~~~~ table.caption patrick@109: table.caption = element caption { caption.content } patrick@17: patrick@17: caption.content = patrick@20: inlines Patrick@138: | (p | speech | \list | blockquote)+ patrick@17: patrick@248: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table.cals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@248: patrick@248: # ~~~~~~ table.cals patrick@248: table.cals = element table { table.attributes, table.cals.content } patrick@248: patrick@248: table.cals.content = patrick@248: block.head?, patrick@248: tgroup+, patrick@248: table.caption? patrick@248: patrick@248: # ~~~~~~ tgroup patrick@248: tgroup = element tgroup { tgroup.attributes, tgroup.content } patrick@248: patrick@248: tgroup.attributes = patrick@248: cols.attribute patrick@248: cols.attribute = attribute cols { xsd:positiveInteger } patrick@248: patrick@248: tgroup.content = patrick@248: thead.cals?, patrick@248: tbody.cals patrick@248: patrick@248: # ~~~~~~ thead, tbody patrick@248: thead.cals = element thead { thead.cals.content } patrick@248: tbody.cals = element tbody { tbody.cals.content } patrick@248: patrick@248: thead.cals.content = patrick@248: row+ patrick@248: tbody.cals.content = patrick@248: row+ patrick@248: patrick@248: # ~~~~~~ row patrick@248: row = element row { row.attributes, row.content } patrick@248: patrick@248: row.attributes = patrick@248: valign.attribute? patrick@248: patrick@248: row.content = patrick@248: table.cals.entry+ patrick@248: patrick@248: # ~~~~~~ table.cals.entry patrick@248: table.cals.entry = element entry { patrick@248: table.cals.entry.attributes, table.cals.entry.content } patrick@248: patrick@248: table.cals.entry.attributes = patrick@248: align.attribute? patrick@248: & valign.attribute? patrick@248: patrick@248: table.cals.entry.content = patrick@248: inlines patrick@248: | (p | media)+ patrick@248: patrick@35: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@2: # ~~~~~~ media patrick@245: media = element media { media.attributes, media.content } patrick@245: patrick@245: media.attributes = Patrick@279: xmlid.attribute? Patrick@279: & media.type.attribute? patrick@245: media.type.attribute = attribute type { xsd:NCName } patrick@0: patrick@0: media.content = patrick@24: block.head?, Patrick@288: (media.image | audio | video)+, patrick@109: media.caption?, patrick@36: link? patrick@0: patrick@2: # ~~~~~~ image Patrick@288: image = element image { image.attributes } Patrick@288: media.image = element image { image.attributes, media.image.content } patrick@0: patrick@0: image.attributes = patrick@104: media.id.attribute Patrick@312: & image.type.attribute? Coraline@407: & image.zoom.attribute? Patrick@312: & alt.attribute? patrick@17: media.id.attribute = attribute id { xsd:NMTOKEN } Patrick@312: image.type.attribute = attribute type { Patrick@312: "cover" | "thumbnail" | "icon" | "animation" } Coraline@407: image.zoom.attribute = attribute zoom {"true" | "false"} Patrick@312: alt.attribute = attribute alt { text } patrick@0: Patrick@288: media.image.content = patrick@111: copyright?, Patrick@176: hotspot* patrick@0: patrick@45: # ~~~~~~ audio patrick@45: audio = element audio { audio.attributes } patrick@43: patrick@45: audio.attributes = patrick@43: media.id.attribute patrick@104: & audio.type? Coraline@409: audio.type = attribute type { "music" | "voice" | "en" | "fr" | "background" Coraline@409: | "smil" } patrick@43: patrick@119: # ~~~~~~ video patrick@119: video = element video { video.attributes } patrick@119: patrick@119: video.attributes = patrick@119: media.id.attribute patrick@119: patrick@122: # ~~~~~~ hotspot patrick@122: hotspot = element hotspot { hotspot.attributes, hotspot.content } patrick@122: patrick@122: hotspot.attributes = patrick@122: x.attribute patrick@122: & y.attribute patrick@182: & w.attribute Patrick@183: & h.attribute? Patrick@236: & hotspot.display.attribute? Patrick@237: & hotspot.type.attribute? Patrick@191: & xmlid.attribute? Patrick@173: x.attribute = attribute x { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} } Patrick@173: y.attribute = attribute y { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} } patrick@182: w.attribute = attribute w { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} } patrick@182: h.attribute = attribute h { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} } Patrick@236: hotspot.display.attribute = attribute display { "normal" | "visible" | "pulse" } Patrick@237: hotspot.type.attribute = attribute type { xsd:NCName } Patrick@310: Patrick@191: hotspot.content = Patrick@288: ((link | p+ | image | audio | video), (spot, scenario?)?) Patrick@191: | (spot, scenario?) Patrick@310: | empty Patrick@310: Patrick@191: # ~~~~~~ spot Patrick@191: spot = element spot { spot.attributes, spot.content } Patrick@191: Patrick@191: spot.attributes = Patrick@191: dx.attribute? Patrick@191: & dy.attribute? Patrick@191: & dw.attribute? Patrick@191: & dh.attribute? patrick@188: dx.attribute = attribute dx { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} } patrick@188: dy.attribute = attribute dy { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} } Patrick@191: dw.attribute = attribute dw { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} } Patrick@191: dh.attribute = attribute dh { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} } Patrick@191: Patrick@191: spot.content = Patrick@191: ((p+ | image), audio?) Patrick@191: | audio Patrick@191: | video Patrick@191: patrick@109: # ~~~~~~ media.caption patrick@109: media.caption = element caption { caption.attributes, caption.content } patrick@109: patrick@109: caption.attributes = patrick@109: x.attribute? patrick@109: & y.attribute? patrick@109: Patrick@191: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scenario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@191: Patrick@191: # ~~~~~~ scenario Patrick@191: scenario = element scenario { scenario.content } Patrick@191: Patrick@191: scenario.content = Patrick@191: init*, Patrick@191: onclick* Patrick@191: Patrick@191: # ~~~~~~ init Patrick@191: init = element init { init.attributes } Patrick@191: Patrick@191: init.attributes = Patrick@191: init.action.attribute Patrick@191: & target.attribute? Patrick@191: init.action.attribute = attribute action { "hide" } Patrick@191: target.attribute = attribute target { "hotspot" | "spot" } Patrick@191: Patrick@191: # ~~~~~~ onclick Patrick@191: onclick = element onclick { onclick.attributes } Patrick@191: Patrick@191: onclick.attributes = Patrick@191: onclick.action.attribute Patrick@191: & target.attribute? Patrick@191: onclick.action.attribute = attribute action { "show" } Patrick@191: Patrick@397: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@189: Patrick@189: # ~~~~~~ bibliography.entry Patrick@189: bibliography.entry = element entry { bibliography.entry.content } Patrick@189: Patrick@189: bibliography.entry.content = Patrick@189: identifier.ean? Patrick@189: & title Patrick@189: & subtitle? Patrick@189: & copyright? Patrick@189: & collection? Patrick@189: & contributors? Patrick@189: & date? Patrick@189: & place? Patrick@189: & folio? Patrick@189: & pages? Patrick@189: Patrick@189: # ~~~~~~ folio Patrick@189: folio = element folio { folio.content } Patrick@189: Patrick@189: folio.content = xsd:positiveInteger | xsd:token {pattern = "[DLXVI]+"} Patrick@189: Patrick@189: # ~~~~~~ pages Patrick@189: pages = element pages { pages.content } Patrick@189: Patrick@189: pages.content = xsd:positiveInteger Patrick@189: patrick@0: patrick@0: # ============================================================================= patrick@20: # INLINE LEVEL patrick@0: # ============================================================================= patrick@0: patrick@0: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: Patrick@288: simple.inlines = mixed { patrick@0: sup* patrick@0: & sub* patrick@42: & var* patrick@13: & number* Patrick@212: & acronym* Patrick@288: & warning* Patrick@288: } Patrick@288: Patrick@293: inlines = mixed { Patrick@293: sup* Patrick@293: & sub* Patrick@293: & var* Patrick@293: & number* Patrick@293: & acronym* Patrick@293: & warning* Patrick@293: Patrick@212: & highlight* Patrick@238: & emphasis* Patrick@212: & mentioned* Patrick@350: & literal* Patrick@350: & term* Patrick@288: & stage* Patrick@350: & name* Patrick@350: & foreign* Patrick@350: & date* Patrick@350: & math* Patrick@351: & quote* Patrick@212: & initial* Patrick@288: & note* Patrick@288: & link* Patrick@288: & anchor* Patrick@288: & index* Patrick@351: & image* Patrick@351: & audio* Patrick@351: & smil* Patrick@293: } patrick@0: patrick@42: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@252: sup = element sup { mixed { var* & warning* } } patrick@0: patrick@252: sub = element sub { mixed { var* & warning* } } patrick@42: Patrick@225: var = element var { mixed { warning* } } patrick@42: patrick@90: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: number = element number { patrick@90: ( attribute type {"roman"}, number.attributes, number.roman.content ) patrick@90: | ( number.attributes, number.content) patrick@90: } patrick@90: patrick@90: number.attributes = patrick@90: number.value.attribute? patrick@90: number.value.attribute = attribute value { xsd:integer | xsd:decimal } patrick@90: Patrick@212: number.content = mixed { sup* & warning* } patrick@246: number.roman.content = xsd:token {pattern = "[MCLXVI]+"} patrick@90: Patrick@350: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ acronym ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@350: Patrick@350: acronym = element acronym { acronym.content } Patrick@350: Patrick@350: acronym.content = mixed { sup* & warning* } Patrick@350: Patrick@350: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ highlight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@350: Patrick@350: highlight = element highlight { highlight.content } Patrick@350: Patrick@350: highlight.content = inlines Patrick@350: Patrick@350: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ emphasis ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@350: Patrick@350: emphasis = element emphasis { emphasis.content } Patrick@350: Patrick@350: emphasis.content = inlines Patrick@350: Patrick@350: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mentioned ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@350: Patrick@350: mentioned = element mentioned { mentioned.content } Patrick@350: Patrick@350: mentioned.content = inlines Patrick@350: Patrick@350: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ literal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@350: Patrick@350: literal = element literal { literal.content } Patrick@350: Patrick@350: literal.content = inlines Patrick@350: Patrick@350: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ term ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@350: Patrick@350: term = element term { term.content } Patrick@350: Patrick@350: term.content = mixed { sup* & warning* } Patrick@350: Patrick@350: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ stage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@350: Patrick@350: stage = element stage { stage.content } Patrick@350: Patrick@350: stage.content = inlines Patrick@350: Patrick@350: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@350: Patrick@350: name = element name { name.attributes, name.content } Patrick@350: Patrick@350: name.attributes = Patrick@350: name.of.attribute? Patrick@350: name.of.attribute = attribute of { Patrick@350: "person" | "company" | "book" | "newspaper" | "party" | "movie" Patrick@350: | "painting" } Patrick@350: Patrick@350: name.content = mixed { sup* & number* & acronym* & warning* } Patrick@350: Patrick@350: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@350: Patrick@350: foreign = element foreign { foreign.attributes, foreign.content } Patrick@350: Patrick@350: foreign.attributes = Patrick@350: lang.attribute? Patrick@350: Patrick@350: foreign.content = inlines Patrick@350: Patrick@350: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@350: Patrick@350: date = element date { date.attributes, date.content } Patrick@350: Patrick@350: date.attributes = Patrick@350: date.value.attribute Patrick@350: & date.of.attribute? Patrick@350: date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear } Patrick@350: date.of.attribute = attribute of { "birth" | "death" } Patrick@350: Patrick@350: date.content = mixed { sup* & number* & warning* } Patrick@350: patrick@42: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ math ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@42: Patrick@274: # ~~~~~~ math Patrick@274: math = element math { math.attributes, math.content } patrick@42: patrick@42: math.attributes = Patrick@280: xmlid.attribute? Patrick@280: & math.display.attribute? Patrick@274: math.display.attribute = attribute display { Patrick@272: "wide" | "numbered" | "box" | "numbered-box" } patrick@42: Patrick@274: math.content = Patrick@274: mixed { sup* & sub* & var* & warning* } Patrick@274: | latex Patrick@274: Patrick@274: # ~~~~~~ latex Patrick@274: latex = element latex { latex.attributes, latex.content } Patrick@274: Patrick@274: latex.attributes = Patrick@274: plain.attritute? Patrick@274: plain.attritute = attribute plain { xsd:boolean } Patrick@274: Patrick@274: latex.content = text patrick@0: patrick@36: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@5: patrick@5: quote = element quote { quote.content } patrick@5: patrick@131: quote.content = patrick@131: (phrase, attribution) | inlines patrick@131: patrick@131: phrase = element phrase { phrase.content } patrick@131: patrick@131: phrase.content = inlines patrick@5: Patrick@351: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ initial ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@105: Patrick@351: initial = element initial { initial.content } patrick@105: Patrick@351: initial.content = Patrick@351: initial.c, Patrick@351: initial.w? patrick@105: Patrick@351: initial.c = element c { text } Patrick@351: initial.w = element w { inlines } Patrick@205: Patrick@288: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@288: Patrick@288: note = element note { note.attributes, note.content } Patrick@288: Patrick@288: note.attributes = Patrick@288: note.label.attribute? Patrick@288: note.label.attribute = attribute label { text } Patrick@288: Patrick@288: note.content = Patrick@288: (note.w?, block+) Patrick@288: | inlines Patrick@288: Patrick@288: note.w = element w { inlines } Patrick@288: Patrick@288: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@288: Patrick@288: link = element link { link.attributes, link.content } Patrick@288: Patrick@288: link.attributes = Patrick@288: (uri.attribute | idref.attribute) Patrick@288: uri.attribute = attribute uri { xsd:anyURI } Patrick@288: idref.attribute = attribute idref { xsd:IDREF } Patrick@288: Patrick@288: link.content = simple.inlines Patrick@288: Patrick@288: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@288: Patrick@288: anchor = element anchor { anchor.attributes, anchor.content } Patrick@288: Patrick@288: anchor.attributes = Patrick@288: anchor.id.attribute Patrick@288: anchor.id.attribute = attribute xml:id { xsd:ID } Patrick@288: Patrick@288: anchor.content = simple.inlines Patrick@288: Patrick@351: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ smil ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@351: Patrick@351: smil = element smil { smil.attributes, smil.content } Patrick@351: Patrick@351: smil.attributes = Patrick@351: audio.attribute? Patrick@351: & begin.attribute? Patrick@351: & end.attribute? Patrick@351: audio.attribute = attribute audio { xsd:anyURI } Patrick@351: begin.attribute = attribute begin { xsd:decimal } Patrick@351: end.attribute = attribute end { xsd:decimal } Patrick@351: Patrick@351: smil.content = inlines Patrick@351: Patrick@205: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@205: Patrick@285: warning = element warning { warning.attributes, warning.content } Patrick@285: Patrick@285: warning.attributes = Patrick@285: warning.type.attribute? Patrick@285: warning.type.attribute = attribute type { xsd:NCName } Patrick@205: Patrick@231: warning.content = inlines