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@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@217: (title, shorttitle?, subtitle*)? patrick@156: & (identifier, 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@90: & abstract? patrick@90: & cover? patrick@90: & annotation* patrick@90: patrick@0: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@90: # ~~~~~~ document patrick@0: document = element document { document.attributes, document.content } patrick@0: patrick@0: document.attributes = patrick@0: 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@0: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@18: top.topic = element topic { top.topic.attributes, top.topic.content } patrick@0: patrick@20: top.topic.attributes = patrick@20: 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@70: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@90: # ~~~~~~ division patrick@0: division = element division { division.content } patrick@0: patrick@0: division.content = patrick@20: division.head?, Patrick@217: front?, patrick@56: (division | topic)+ patrick@0: patrick@90: # ~~~~~~ division.head patrick@90: division.head = element head { division.head.content } patrick@90: patrick@90: division.head.content = Patrick@217: (title, shorttitle?, subtitle*)? patrick@90: & abstract? patrick@90: & annotation* patrick@90: Patrick@217: # ~~~~~~ front 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@217: (title, shorttitle?, subtitle*)? patrick@90: & contributors? patrick@143: & date? patrick@143: & place? patrick@143: & keywordset? patrick@143: & subjectset? patrick@90: & abstract? patrick@90: & 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@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@90: # ~~~~~~ section patrick@58: section = element section { section.attributes, section.content } patrick@58: patrick@58: section.attributes = patrick@58: 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@90: # ~~~~~~ section.head patrick@90: section.head = element head { section.head.content } patrick@90: patrick@90: section.head.content = Patrick@217: (title, shorttitle?, subtitle*)? Marc@177: & keywordset? Marc@177: & subjectset? patrick@90: & abstract? patrick@105: & audio* patrick@90: & annotation* patrick@90: Patrick@189: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@189: Patrick@189: # ~~~~~~ bibliography 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@20: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@9: patrick@90: # ~~~~~~ block patrick@44: block = (p | speech | \list | blockquote | table | media) patrick@9: patrick@90: # ~~~~~~ block.head patrick@90: block.head = element head { block.head.content } patrick@90: patrick@90: block.head.content = Patrick@217: (title, shorttitle?, subtitle*)? patrick@90: patrick@42: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@20: p = element p { p.content } patrick@0: patrick@20: p.content = patrick@0: inlines patrick@0: patrick@18: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@18: patrick@18: # ~~~~~~ speech patrick@18: speech = element speech { speech.content } patrick@18: patrick@18: speech.content = patrick@18: speaker?, patrick@18: stage?, Patrick@199: (p | blockquote)+ patrick@18: patrick@18: # ~~~~~~ speaker patrick@18: speaker = element speaker { speaker.content } patrick@18: patrick@18: speaker.content = inlines patrick@18: 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@44: blockquote = element blockquote { blockquote.content } patrick@44: 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@225: & highlight* & mentioned* & warning* } patrick@44: patrick@17: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@17: patrick@73: # ~~~~~~ table patrick@17: table = element table { table.content } patrick@17: patrick@17: table.content = patrick@20: block.head?, patrick@17: tgroup+, patrick@109: table.caption? patrick@17: patrick@17: # ~~~~~~ tgroup patrick@17: tgroup = element tgroup { tgroup.attributes, tgroup.content } patrick@17: patrick@17: tgroup.content = patrick@17: thead?, patrick@17: tbody patrick@17: patrick@17: tgroup.attributes = patrick@17: cols.attribute patrick@17: & align.attribute? patrick@17: & colsep.attribute? patrick@17: & rowsep.attribute? patrick@17: cols.attribute = attribute cols { xsd:positiveInteger } patrick@17: align.attribute = attribute align { "left" | "right" | "center" | "justify" } patrick@17: colsep.attribute = attribute colsep { "0" | "1" } patrick@17: rowsep.attribute = attribute rowsep { "0" | "1" } patrick@17: patrick@146: # ~~~~~~ thead, tbody patrick@22: thead = element thead { thead.attributes, thead.content } patrick@22: tbody = element tbody { tbody.attributes, tbody.content } patrick@17: patrick@22: thead.attributes = patrick@22: valign.attribute? patrick@22: tbody.attributes = patrick@22: valign.attribute? patrick@22: valign.attribute = attribute valign { "top" | "middle" | "bottom" } patrick@75: patrick@17: thead.content = patrick@17: row+ patrick@17: tbody.content = patrick@17: row+ patrick@17: patrick@17: # ~~~~~~ row patrick@146: row = element row { row.attributes, row.content } patrick@17: patrick@146: row.attributes = patrick@17: valign.attribute? patrick@146: & rowsep.attribute? patrick@17: patrick@17: row.content = Patrick@189: table.entry+ patrick@17: Patrick@189: # ~~~~~~ table.entry Patrick@189: table.entry = element entry { table.entry.attributes, table.entry.content } patrick@146: Patrick@189: table.entry.attributes = patrick@146: align.attribute? patrick@146: & valign.attribute? patrick@146: & colsep.attribute? patrick@146: & rowsep.attribute? patrick@17: Patrick@189: table.entry.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@35: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@2: # ~~~~~~ media patrick@0: media = element media { media.content } patrick@0: patrick@0: media.content = patrick@24: block.head?, patrick@119: (image | audio | video)+, patrick@109: media.caption?, patrick@36: link? patrick@0: patrick@2: # ~~~~~~ image patrick@0: image = element image { image.attributes, image.content } Patrick@191: hotspot.image = element image {image.attributes } patrick@0: patrick@0: image.attributes = patrick@104: media.id.attribute patrick@104: & image.type? patrick@17: media.id.attribute = attribute id { xsd:NMTOKEN } Patrick@184: image.type = attribute type { "cover" | "thumbnail" | "icon" | "animation" } patrick@0: patrick@0: 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? patrick@113: audio.type = attribute type { "music" | "voice" | "background" | "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@191: & 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@183: hotspot.type.attribute = attribute type { "normal" | "visible" | "pulse" } Patrick@191: Patrick@191: hotspot.content = Patrick@191: ((link | p+ | hotspot.image | audio | video), (spot, scenario?)?) Patrick@191: | (spot, scenario?) Patrick@191: 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@189: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliograpgy.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@90: # HEAD LEVEL patrick@90: # ============================================================================= patrick@90: patrick@127: # ~~~~~~~~~~~~~~~~~~~~~~~ title, shorttitle, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: title = element title { title.content } patrick@127: shorttitle = element shorttitle { title.content } patrick@90: subtitle = element subtitle { title.content } patrick@90: patrick@90: title.content = inlines patrick@90: patrick@90: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@156: identifier = element identifier { patrick@156: (attribute type { "ean" }, xsd:token {pattern = "\d{13}"}) patrick@156: | (attribute type { "uri" }, xsd:anyURI) patrick@90: } patrick@90: patrick@90: identifier.ean = element identifier { patrick@90: attribute type { "ean" }, xsd:token {pattern = "\d{13}"} patrick@90: } patrick@90: patrick@156: identifier.uri = element identifier { patrick@156: attribute type { "uri" }, xsd:anyURI patrick@156: } patrick@90: patrick@90: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: copyright = element copyright { copyright.content } patrick@90: patrick@90: copyright.content = inlines patrick@90: Patrick@155: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ collection ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@155: Patrick@155: collection = element collection { collection.content } Patrick@155: Patrick@155: collection.content = inlines Patrick@155: patrick@90: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ contributors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: # ~~~~~~ contributors patrick@90: contributors = element contributors { contributors.content } patrick@90: patrick@90: contributors.content = patrick@90: contributor+ patrick@90: patrick@90: # ~~~~~~ contributor patrick@90: contributor = element contributor { contributor.content } patrick@90: patrick@90: contributor.content = patrick@90: (((firstname, secondname?)?, lastname) | label), patrick@90: address?, patrick@90: link?, patrick@101: role+ patrick@90: patrick@90: # ~~~~~~ firstname, secondname, lastname, label patrick@90: firstname = element firstname { firstname.content } patrick@90: secondname = element secondname { secondname.content } patrick@90: lastname = element lastname { lastname.content } patrick@90: label = element label { label.content } patrick@90: patrick@90: firstname.content = inlines patrick@90: secondname.content = inlines patrick@90: lastname.content = inlines patrick@90: label.content = inlines patrick@90: patrick@90: # ~~~~~~ address patrick@90: address = element address { address.content } patrick@90: patrick@90: address.content = inlines patrick@90: patrick@90: # ~~~~~~ role patrick@90: role = element role { role.content } patrick@90: patrick@90: role.content = "author" | "illustrator" | "publisher" | "packager" patrick@90: patrick@90: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: place = element place { place.content } patrick@90: patrick@90: place.content = inlines patrick@90: patrick@90: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: source = element source { Patrick@189: ( (attribute type { "book" }, bibliography.entry.content) patrick@90: | (attribute type { "file" }, source.content.file)), patrick@90: source.content patrick@90: } patrick@90: patrick@90: source.content.file = patrick@90: identifier.uri patrick@90: source.content = patrick@90: annotation* patrick@90: Patrick@189: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: # ~~~~~~ keywordset patrick@90: keywordset = element keywordset { keywordset.content } patrick@90: patrick@90: keywordset.content = keyword+ patrick@90: patrick@90: # ~~~~~~ keyword patrick@90: keyword = element keyword { keyword.content } patrick@90: patrick@90: keyword.content = mixed { sup*, sub* } patrick@90: patrick@90: # ~~~~~~ subjectset patrick@90: subjectset = element subjectset { subjectset.content } patrick@90: patrick@90: subjectset.content = subject+ patrick@90: patrick@90: # ~~~~~~ subject patrick@132: subject = element subject { subject.content } patrick@90: Patrick@214: subject.content = mixed { sup*, sub* } patrick@90: patrick@90: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ abstract ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: abstract = element abstract { abstract.content } patrick@90: patrick@90: abstract.content = patrick@90: p+ patrick@90: patrick@90: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: cover = element cover { cover.content } patrick@90: patrick@90: cover.content = patrick@90: cover.image patrick@90: patrick@90: cover.image = element image { cover.image.attributes } patrick@90: patrick@90: cover.image.attributes = patrick@90: cover.image.id.attribute patrick@90: cover.image.id.attribute = attribute id { xsd:NMTOKEN } patrick@105: patrick@90: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@90: patrick@90: annotation = element annotation { annotation.content } patrick@90: patrick@90: annotation.content = inlines patrick@90: patrick@90: patrick@90: # ============================================================================= patrick@20: # INLINE LEVEL patrick@0: # ============================================================================= patrick@0: patrick@0: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@0: inlines = mixed { patrick@0: sup* patrick@0: & sub* patrick@42: & var* patrick@13: & number* patrick@42: & math* patrick@0: & date* patrick@0: & name* Patrick@212: & foreign* Patrick@212: & acronym* Patrick@212: & term* Patrick@212: & literal* Patrick@212: & stage* Patrick@212: & highlight* Patrick@212: & mentioned* Patrick@212: & initial* patrick@5: & note* patrick@5: & quote* patrick@25: & link* patrick@42: & anchor* patrick@93: & image* Patrick@208: & audio* patrick@105: & smil* Patrick@205: & warning* patrick@0: } patrick@0: patrick@42: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: Patrick@225: sup = element sup { mixed { warning* } } patrick@0: Patrick@225: sub = element sub { mixed { 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@157: number.roman.content = xsd:token {pattern = "[DLXVI]+"} patrick@90: patrick@42: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ math ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@42: patrick@42: math = element math { patrick@42: ( attribute notation {"tex"}, math.attributes, math.tex.content ) patrick@42: | ( math.attributes, math.content) patrick@42: } patrick@42: patrick@42: math.attributes = patrick@42: wide.attribute? patrick@42: wide.attribute = attribute wide { xsd:boolean } patrick@42: Patrick@225: math.content = mixed { sup* & sub* & var* & warning* } patrick@42: math.tex.content = text patrick@0: patrick@36: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ date ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@0: date = element date { date.attributes, date.content } patrick@0: patrick@3: date.attributes = patrick@13: date.value.attribute patrick@13: & date.of.attribute? patrick@13: date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear } patrick@33: date.of.attribute = attribute of { "birth" | "death" } patrick@0: Patrick@226: date.content = mixed { sup* & number* & warning* } patrick@0: patrick@36: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ name ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@0: name = element name { name.attributes, name.content } patrick@2: patrick@2: name.attributes = patrick@2: name.of.attribute? Patrick@226: name.of.attribute = attribute of { Patrick@226: "person" | "company" | "book" | "newspaper" | "party" | "movie" Patrick@226: | "painting" } patrick@0: Patrick@212: name.content = mixed { sup* & number* & acronym* & warning* } Patrick@212: Patrick@212: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@212: Patrick@212: foreign = element foreign { foreign.attributes, foreign.content } Patrick@212: Patrick@212: foreign.attributes = Patrick@212: lang.attribute? Patrick@212: Patrick@212: foreign.content = mixed { sup* & sub* & number* & warning* } Patrick@212: Patrick@212: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ acronym ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@212: Patrick@212: acronym = element acronym { acronym.content } Patrick@212: Patrick@212: acronym.content = mixed { sup* & warning* } Patrick@212: Patrick@212: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ term ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@212: Patrick@212: term = element term { term.content } Patrick@212: Patrick@212: term.content = mixed { sup* & warning* } Patrick@212: Patrick@212: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ literal ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@212: Patrick@212: literal = element literal { literal.content } Patrick@212: Patrick@212: literal.content = mixed { sup* & warning* } Patrick@212: Patrick@212: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ stage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@212: Patrick@212: stage = element stage { stage.content } Patrick@212: Patrick@212: stage.content = inlines Patrick@212: Patrick@212: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ highlight ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@212: Patrick@212: highlight = element highlight { highlight.content } Patrick@212: Patrick@212: highlight.content = inlines Patrick@212: Patrick@212: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mentioned ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@212: Patrick@212: mentioned = element mentioned { mentioned.content } Patrick@212: Patrick@212: mentioned.content = inlines Patrick@212: Patrick@212: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ initial ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@212: Patrick@212: initial = element initial { initial.content } Patrick@212: Patrick@212: initial.content = Patrick@212: c, Patrick@212: w? Patrick@212: Patrick@212: c = element c { text } Patrick@212: w = element w { inlines } patrick@2: patrick@36: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ note ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@5: note = element note { note.attributes, note.content } patrick@0: patrick@5: note.attributes = patrick@5: note.label.attribute? patrick@5: note.label.attribute = attribute label { text } patrick@0: patrick@5: note.content = claire@180: (w?, block+) | inlines patrick@91: 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@36: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@0: patrick@0: link = element link { link.attributes, link.content } patrick@0: patrick@9: link.attributes = patrick@42: (uri.attribute | idref.attribute) patrick@9: uri.attribute = attribute uri { xsd:anyURI } patrick@9: idref.attribute = attribute idref { xsd:IDREF } patrick@0: Patrick@225: link.content = mixed { Patrick@212: sup* & sub* & var* & number* & math* & date* & name* & foreign* & acronym* Patrick@212: & term* & literal* & stage* & highlight* & mentioned* & warning* } patrick@42: patrick@42: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@42: Patrick@147: anchor = element anchor { anchor.attributes, anchor.content } patrick@42: patrick@42: anchor.attributes = patrick@42: anchor.id.attribute patrick@42: anchor.id.attribute = attribute xml:id { xsd:ID } patrick@91: Patrick@147: anchor.content = inlines Patrick@147: patrick@105: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ smil ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ patrick@105: patrick@105: smil = element smil { smil.attributes, smil.content } patrick@105: patrick@105: smil.attributes = Patrick@207: audio.attribute? Patrick@207: & begin.attribute? patrick@105: & end.attribute? Patrick@207: audio.attribute = attribute audio { xsd:anyURI } patrick@105: begin.attribute = attribute begin { xsd:decimal } patrick@105: end.attribute = attribute end { xsd:decimal } patrick@105: patrick@105: smil.content = inlines Patrick@205: Patrick@205: # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ warning ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Patrick@205: Patrick@205: warning = element warning { warning.content } Patrick@205: Patrick@225: warning.content = text