# HG changeset patch # User iinov # Date 1547999411 -3600 # Node ID 6c30a3543cd82e7b130741340866dcc3be9da013 # Parent e415b3d474a1524fb59912191e4302c31d4e4f91 Restructuration diff -r e415b3d474a1 -r 6c30a3543cd8 RelaxNG/publianim.rnc --- a/RelaxNG/publianim.rnc sam. déc. 01 08:49:14 2018 +0100 +++ b/RelaxNG/publianim.rnc dim. janv. 20 16:50:11 2019 +0100 @@ -63,7 +63,7 @@ publianim.content = document - | top.topic + | topic # ============================================================================= diff -r e415b3d474a1 -r 6c30a3543cd8 RelaxNG/publidoc.rnc --- a/RelaxNG/publidoc.rnc sam. déc. 01 08:49:14 2018 +0100 +++ b/RelaxNG/publidoc.rnc dim. janv. 20 16:50:11 2019 +0100 @@ -1,22 +1,21 @@ - start = publidoc publidoc = element publidoc { - publidoc.attributes, - publidoc.content -} + publidoc.attributes, + publidoc.content + } publidoc.attributes = - version.attribute + version.attribute version.attribute = attribute version { "1.0" } publidoc.content = - document - | top.topic - | glossary + document + | glossary + | topic # ============================================================================= -# HEAD LEVEL +# HEAD # ============================================================================= # ~~~~~~~~~~~~~~~~~~~~~~~ title, shorttitle, subtitle ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -30,20 +29,21 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ identifier -identifier = element identifier { - (attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"}) - | (attribute type { "uri" }, for.attribute?, xsd:anyURI) -} +identifier = + element identifier { + (attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"}) | + (attribute type { "uri" }, for.attribute?, xsd:anyURI) + } # ~~~~~~ identifier.ean -identifier.ean = element identifier { - attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"} -} +identifier.ean = + element identifier { + attribute type { "ean" }, for.attribute?, xsd:token {pattern = "\d{13}"} + } # ~~~~~~ identifier.uri -identifier.uri = element identifier { - attribute type { "uri" }, for.attribute?, xsd:anyURI -} +identifier.uri = + element identifier { attribute type { "uri" }, for.attribute?, xsd:anyURI } # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -63,17 +63,17 @@ contributors = element contributors { contributors.content } contributors.content = - contributor+ + contributor+ # ~~~~~~ contributor contributor = element contributor { contributor.content } contributor.content = - identifier.uri?, - ((firstname?, lastname) | label), - address?, - link?, - role+ + identifier.uri?, + ((firstname?, lastname) | label), + address?, + link?, + role+ # ~~~~~~ firstname, secondname, lastname, label firstname = element firstname { firstname.content } @@ -92,8 +92,8 @@ # ~~~~~~ role role = element role { role.content } -role.content = "author" | "illustrator" | "publisher" | "packager" - | "translator" +role.content = + "author" | "illustrator" | "publisher" | "packager" | "translator" # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ place ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -103,16 +103,17 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ source ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -source = element source { - ( (attribute type { "book" }, bibliography.entry.content) - | (attribute type { "file" }, source.content.file)), - source.content -} +source = + element source { + ( (attribute type { "book" }, bibliography.entry.content) | + (attribute type { "file" }, source.content.file) ), + source.content + } source.content.file = - identifier.uri + identifier.uri source.content = - annotation? + annotation? # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ keyword & subject ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -148,10 +149,10 @@ head.index = element index { head.index.content } index.content = - (index.w, index.entry?) - | (index.entry, (index.w | index.entry)?) + (index.w, index.entry?) + | (index.entry, (index.w | index.entry)?) head.index.content = - index.entry, index.entry? + index.entry, index.entry? # ~~~~~~ index.w index.w = element w { simple.inlines } @@ -164,102 +165,88 @@ abstract = element abstract { abstract.content } abstract.content = - p+ + p+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover = element cover { cover.content } cover.content = - cover.image + cover.image cover.image = element image { cover.image.attributes } cover.image.attributes = - media.id.attribute + media.id.attribute # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation = element annotation { annotation.content } annotation.content = - inlines | p+ + inlines | p+ # ============================================================================= -# TOP LEVEL +# DOCUMENT # ============================================================================= -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -top.head = element head { top.head.content } +document.head = element head { document.head.content } -top.head.content = - (title & shorttitle? & subtitle*)? - & identifier* - & copyright* - & collection? - & contributors? - & date? - & place? - & (source, source?)? - & keywordset? - & subjectset? - & indexset? - & abstract? - & cover? - & annotation? +document.head.content = + (title & shorttitle? & subtitle*)? + & identifier* + & copyright* + & collection? + & contributors? + & date? + & place? + & (source, source?)? + & keywordset? + & subjectset? + & indexset? + & abstract? + & cover? + & annotation? # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ document = element document { document.attributes, document.content } document.attributes = - document.id.attribute? - & document.type.attribute? - & lang.attribute? + document.id.attribute? + & document.type.attribute? + & lang.attribute? document.id.attribute = attribute id { xsd:NMTOKEN } document.type.attribute = attribute type { xsd:NCName } lang.attribute = attribute xml:lang { xsd:language } document.content = - top.head?, - (division | topic | glossary)+ + document.head?, + (division | document.topic | glossary)+ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -top.topic = element topic { top.topic.attributes, top.topic.content } - -top.topic.attributes = - topic.id.attribute? - & topic.type.attribute? - & lang.attribute? -topic.id.attribute = attribute id { xsd:NMTOKEN } -topic.type.attribute = attribute type { xsd:NCName } - -top.topic.content = - top.head?, - header?, - ((section+, bibliography?) | bibliography), - footer? - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glossary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ============================================================================= +# GLOSSARY +# ============================================================================= glossary = element glossary { glossary.attributes, glossary.content } glossary.attributes = - glossary.type.attribute? - & lang.attribute? - & langto.attribute? + glossary.type.attribute? + & lang.attribute? + & langto.attribute? glossary.type.attribute = attribute type { xsd:NCName } langto.attribute = attribute langto { xsd:language } glossary.content = - glossary.entry+ + glossary.entry+ # ============================================================================= -# DIVISION LEVEL +# DIVISION # ============================================================================= # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -267,66 +254,83 @@ division.head = element head { division.head.content } division.head.content = - (title & shorttitle? & subtitle*)? - & indexset? - & abstract? - & annotation? + (title & shorttitle? & subtitle*)? + & indexset? + & abstract? + & annotation? # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ division = element division { division.attributes, division.content } division.attributes = - division.type.attribute? + division.type.attribute? division.type.attribute = attribute type { xsd:NCName } division.content = - division.head?, - front?, - (division | topic)+ + division.head?, + front?, + (division | document.topic)+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ front ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ front = element front { front.content } front.content = - section+ + section+ # ============================================================================= -# COMPONENT LEVEL +# COMPONENTS # ============================================================================= -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ component.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ component.head ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -component.head = element head { component.head.content } +# ~~~~~~ component.head +component.head = element head { document.head.content } -component.head.content = - (title & shorttitle? & subtitle*)? - & contributors? - & date? - & place? - & keywordset? - & subjectset? - & indexset? - & abstract? - & annotation? +# ~~~~~~ document.component.head +document.component.head = element head { document.component.head.content } + +document.component.head.content = + (title & shorttitle? & subtitle*)? + & contributors? + & date? + & place? + & keywordset? + & subjectset? + & indexset? + & abstract? + & annotation? # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ topic = element topic { topic.attributes, topic.content } +document.topic = + element topic { document.topic.attributes, document.topic.content } topic.attributes = - (topic.id.attribute | xmlid.attribute)? - & topic.type.attribute? - & lang.attribute? + topic.id.attribute? + & topic.type.attribute? + & lang.attribute? +document.topic.attributes = + (topic.id.attribute | xmlid.attribute)? + & topic.type.attribute? + & lang.attribute? +topic.id.attribute = attribute id { xsd:NMTOKEN } +topic.type.attribute = attribute type { xsd:NCName } xmlid.attribute = attribute xml:id { xsd:ID } topic.content = - component.head?, - header?, - ((section+, bibliography?) | bibliography), - footer? + component.head?, + header?, + ((section+, bibliography?) | bibliography), + footer? +document.topic.content = + document.component.head?, + header?, + ((section+, bibliography?) | bibliography), + footer? # ============================================================================= @@ -338,66 +342,66 @@ section.head = element head { section.head.content } section.head.content = - (title & shorttitle? & subtitle*)? - & keywordset? - & subjectset? - & indexset? - & abstract? - & audio* - & annotation? + (title & shorttitle? & subtitle*)? + & keywordset? + & subjectset? + & indexset? + & abstract? + & audio* + & annotation? # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ header ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ header = element header { header.content } header.content = - block+ + block+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section = element section { section.attributes, section.content } section.attributes = - xmlid.attribute? - & section.type.attribute? - & lang.attribute? - & for.attribute? + xmlid.attribute? + & section.type.attribute? + & lang.attribute? + & for.attribute? section.type.attribute = attribute type { xsd:NCName } for.attribute = attribute for { xsd:NCName } section.content = - section.head?, - (section+ | block+) + section.head?, + (section+ | block+) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography = element bibliography { bibliography.content } bibliography.content = - bibliography.entry+ + bibliography.entry+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ footer = element footer { footer.content } footer.content = - block+ + block+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ glossary.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ glossary.entry -glossary.entry= element entry { - glossary.entry.attributes, glossary.entry.content } +glossary.entry= + element entry { glossary.entry.attributes, glossary.entry.content } glossary.entry.attributes = - xmlid.attribute? + xmlid.attribute? glossary.entry.content = - mainterm, - alt-terms?, - media?, - meanings+, - seealso* + mainterm, + alt-terms?, + media?, + meanings+, + seealso* # ~~~~~~ mainterm mainterm = element mainterm { mainterm.content } @@ -429,9 +433,9 @@ block.head = element head { block.head.content } block.head.content = - (title & shorttitle? & subtitle*)? - & indexset? - & annotation? + (title & shorttitle? & subtitle*)? + & indexset? + & annotation? # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -442,30 +446,30 @@ p = element p { p.content } p.content = - inlines + inlines # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ list -\list = element list { - block.head?, - ( (attribute type {"ordered"}?, item, item+) - | (attribute type {"glossary"}, item.glossary+) ) -} +\list = + element list { + block.head?, + ( (attribute type {"ordered"}?, item, item+) | + (attribute type {"glossary"}, item.glossary+) ) } # ~~~~~~ item item = element item { item.content } item.content = - inlines - | block+ + inlines + | block+ # ~~~~~~ item.glossary item.glossary = element item { item.glossary.content } item.glossary.content = - label, - block+ + label, + block+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -473,20 +477,21 @@ blockquote = element blockquote { blockquote.attributes, blockquote.content } blockquote.attributes = - blockquote.type.attribute? + blockquote.type.attribute? blockquote.type.attribute = attribute type { xsd:NCName } blockquote.content = - block.head?, - (p | speech | \list)+, - attribution? + block.head?, + (p | speech | \list)+, + attribution? # ~~~~~~ attribution attribution = element attribution { attribution.content } -attribution.content = mixed { - sup* & number* & date* & name* & foreign* & acronym* & term* & literal* - & highlight* & emphasis* & mentioned* & note* & warning* } +attribution.content = + mixed { + sup* & number* & date* & name* & foreign* & acronym* & term* & literal* + & highlight* & emphasis* & mentioned* & note* & warning* } # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -494,9 +499,9 @@ speech = element speech { speech.content } speech.content = - speaker?, - stage?, - (p | blockquote)+ + speaker?, + stage?, + (p | blockquote)+ # ~~~~~~ speaker speaker = element speaker { speaker.content } @@ -509,60 +514,60 @@ table = element table { table.attributes, table.content } table.attributes = - table.type.attribute? + table.type.attribute? table.type.attribute = attribute type { xsd:NCName } table.content = - block.head?, - ((thead?, tbody+) | tr+), - table.caption? + block.head?, + ((thead?, tbody+) | tr+), + table.caption? # ~~~~~~ thead, tbody thead = element thead { thead.content } tbody = element tbody { tbody.content } thead.content = - tr+ + tr+ tbody.content = - tr+ + tr+ # ~~~~~~ tr tr = element tr { tr.attributes, tr.content } tr.attributes = - align.attribute? - & valign.attribute? - & cell.type.attribute? + align.attribute? + & valign.attribute? + & cell.type.attribute? align.attribute = attribute align { "left" | "right" | "center" | "justify" } valign.attribute = attribute valign { "top" | "middle" | "bottom" } cell.type.attribute = attribute type { xsd:NCName } tr.content = - (td | th)+ + (td | th)+ # ~~~~~~ td, th td = element td { td.attributes, td.content } th = element th { td.attributes, td.content } td.attributes = - align.attribute? - & valign.attribute? - & colspan.attribute? - & rowspan.attribute? - & cell.type.attribute? + align.attribute? + & valign.attribute? + & colspan.attribute? + & rowspan.attribute? + & cell.type.attribute? colspan.attribute = attribute colspan { xsd:positiveInteger } rowspan.attribute = attribute rowspan { xsd:positiveInteger } td.content = - inlines - | (p | media)+ + inlines + | (p | media)+ # ~~~~~~ table.caption table.caption = element caption { caption.content } caption.content = - inlines - | (p | speech | \list | blockquote)+ + inlines + | (p | speech | \list | blockquote)+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table.cals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -570,50 +575,50 @@ table.cals = element table { table.attributes, table.cals.content } table.cals.content = - block.head?, - tgroup+, - table.caption? + block.head?, + tgroup+, + table.caption? # ~~~~~~ tgroup tgroup = element tgroup { tgroup.attributes, tgroup.content } tgroup.attributes = - cols.attribute + cols.attribute cols.attribute = attribute cols { xsd:positiveInteger } tgroup.content = - thead.cals?, - tbody.cals + thead.cals?, + tbody.cals # ~~~~~~ thead, tbody thead.cals = element thead { thead.cals.content } tbody.cals = element tbody { tbody.cals.content } thead.cals.content = - row+ + row+ tbody.cals.content = - row+ + row+ # ~~~~~~ row row = element row { row.attributes, row.content } row.attributes = - valign.attribute? + valign.attribute? row.content = - table.cals.entry+ + table.cals.entry+ # ~~~~~~ table.cals.entry -table.cals.entry = element entry { - table.cals.entry.attributes, table.cals.entry.content } +table.cals.entry = + element entry { table.cals.entry.attributes, table.cals.entry.content } table.cals.entry.attributes = - align.attribute? - & valign.attribute? + align.attribute? + & valign.attribute? table.cals.entry.content = - inlines - | (p | media)+ + inlines + | (p | media)+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -621,68 +626,68 @@ media = element media { media.attributes, media.content } media.attributes = - xmlid.attribute? - & media.type.attribute? + xmlid.attribute? + & media.type.attribute? media.type.attribute = attribute type { xsd:NCName } media.content = - block.head?, - (media.image | audio | video)+, - media.caption?, - link? + block.head?, + (media.image | audio | video)+, + media.caption?, + link? # ~~~~~~ image image = element image { image.attributes } media.image = element image { image.attributes, media.image.content } image.attributes = - media.id.attribute - & image.type.attribute? - & image.zoom.attribute? - & alt.attribute? + media.id.attribute + & image.type.attribute? + & image.zoom.attribute? + & alt.attribute? media.id.attribute = attribute id { xsd:NMTOKEN } -image.type.attribute = attribute type { - "cover" | "thumbnail" | "icon" | "animation" } +image.type.attribute = + attribute type { "cover" | "thumbnail" | "icon" | "animation" } image.zoom.attribute = attribute zoom {"true" | "false"} alt.attribute = attribute alt { text } media.image.content = - copyright?, - hotspot* + copyright?, + hotspot* # ~~~~~~ audio audio = element audio { audio.attributes } audio.attributes = - media.id.attribute - & audio.type? -audio.type = attribute type { "music" | "voice" | "en" | "fr" | "background" - | "smil" } + media.id.attribute + & audio.type? +audio.type = + attribute type { "music" | "voice" | "en" | "fr" | "background" | "smil" } # ~~~~~~ video video = element video { video.attributes } video.attributes = - media.id.attribute + media.id.attribute # ~~~~~~ media.caption media.caption = element caption { caption.attributes, caption.content } caption.attributes = - x.attribute? - & y.attribute? + x.attribute? + & y.attribute? # ~~~~~~ hotspot hotspot = element hotspot { hotspot.attributes, hotspot.content } hotspot.attributes = - x.attribute - & y.attribute - & w.attribute - & h.attribute? - & hotspot.display.attribute? - & hotspot.type.attribute? - & xmlid.attribute? + x.attribute + & y.attribute + & w.attribute + & h.attribute? + & hotspot.display.attribute? + & hotspot.type.attribute? + & xmlid.attribute? x.attribute = attribute x { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} } y.attribute = attribute y { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} } w.attribute = attribute w { xsd:token {pattern = "\d{1,2}(\.\d{1,2})?%"} } @@ -691,27 +696,27 @@ hotspot.type.attribute = attribute type { xsd:NCName } hotspot.content = - ((link | p+ | image | audio | video), (spot, scenario?)?) - | (spot, scenario?) - | empty + ((link | p+ | image | audio | video), (spot, scenario?)?) + | (spot, scenario?) + | empty # ~~~~~~ spot spot = element spot { spot.attributes, spot.content } spot.attributes = - dx.attribute? - & dy.attribute? - & dw.attribute? - & dh.attribute? + dx.attribute? + & dy.attribute? + & dw.attribute? + & dh.attribute? dx.attribute = attribute dx { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} } dy.attribute = attribute dy { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} } dw.attribute = attribute dw { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} } dh.attribute = attribute dh { xsd:token {pattern = "-?\d{1,2}(\.\d{1,2})?%"} } spot.content = - ((p+ | image), audio?) - | audio - | video + ((p+ | image), audio?) + | audio + | video # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ scenario ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -719,15 +724,15 @@ scenario = element scenario { scenario.content } scenario.content = - init*, - onclick* + init*, + onclick* # ~~~~~~ init init = element init { init.attributes } init.attributes = - init.action.attribute - & target.attribute? + init.action.attribute + & target.attribute? init.action.attribute = attribute action { "hide" } target.attribute = attribute target { "hotspot" | "spot" } @@ -735,8 +740,8 @@ onclick = element onclick { onclick.attributes } onclick.attributes = - onclick.action.attribute - & target.attribute? + onclick.action.attribute + & target.attribute? onclick.action.attribute = attribute action { "show" } # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bibliography.entry ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -745,16 +750,16 @@ bibliography.entry = element entry { bibliography.entry.content } bibliography.entry.content = - identifier.ean? - & title - & subtitle? - & copyright? - & collection? - & contributors? - & date? - & place? - & folio? - & pages? + identifier.ean? + & title + & subtitle? + & copyright? + & collection? + & contributors? + & date? + & place? + & folio? + & pages? # ~~~~~~ folio folio = element folio { folio.content } @@ -772,27 +777,27 @@ meanings = element meanings { meanings.attributes, meanings.content } meanings.attributes = - gramcode.attribute? + gramcode.attribute? gramcode.attribute = attribute gramcode { xsd:NMTOKEN } meanings.content = - meaning+ + meaning+ # ~~~~~~ meaning meaning = element meaning { meaning.attributes, meaning.content } meaning.attributes = - meaning.domain.attribute? - & langlevel.attribute? + meaning.domain.attribute? + & langlevel.attribute? meaning.domain.attribute = attribute domain { xsd:NMTOKEN } langlevel.attribute = attribute langlevel { xsd:NMTOKEN } meaning.content = - ((definition, example*, synonym*, antonym*, translation*) + ((definition, example*, synonym*, antonym*, translation*) | (definition?, example*, synonym*, antonym*, translation+) | (definition?, example*, synonym+, antonym*, translation*) | (definition?, example*, synonym*, antonym+, translation*)), - dictum* + dictum* # ~~~~~~ definition definition = element definition { inlines } @@ -813,7 +818,7 @@ seealso = element seealso { seealso.attributes } seealso.attributes = - gloss.ref.attribute + gloss.ref.attribute # ============================================================================= @@ -822,47 +827,47 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -simple.inlines = mixed { - sup* - & sub* - & var* - & number* - & acronym* - & warning* -} +simple.inlines = + mixed { + sup* & sub* + & var* + & number* + & acronym* + & warning* + } -inlines = mixed { - sup* - & sub* - & var* - & number* - & acronym* - & warning* +inlines = + mixed { + sup* & sub* + & var* + & number* + & acronym* + & warning* - & highlight* - & emphasis* - & mentioned* - & literal* - & term* - & example* - & stage* - & name* - & foreign* - & date* - & math* - & quote* - & initial* - & note* - & link* - & anchor* - & index* - & gloss* - & image* - & audio* - & smil* + & highlight* + & emphasis* + & mentioned* + & literal* + & term* + & example* + & stage* + & name* + & foreign* + & date* + & math* + & quote* + & initial* + & note* + & link* + & anchor* + & index* + & gloss* + & image* + & audio* + & smil* - & nowrap* -} + & nowrap* + } # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -874,13 +879,14 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -number = element number { - ( attribute type {"roman"}, number.attributes, number.roman.content ) - | ( number.attributes, number.content) -} +number = + element number { + ( attribute type {"roman"}, number.attributes, number.roman.content ) | + ( number.attributes, number.content) + } number.attributes = - number.value.attribute? + number.value.attribute? number.value.attribute = attribute value { xsd:integer | xsd:decimal } number.content = mixed { sup* & warning* } @@ -939,10 +945,11 @@ name = element name { name.attributes, name.content } name.attributes = - name.of.attribute? -name.of.attribute = attribute of { - "person" | "company" | "book" | "newspaper" | "party" | "movie" - | "painting" } + name.of.attribute? +name.of.attribute = + attribute of { + "person" | "company" | "book" | "newspaper" | "party" | "movie" + | "painting" } name.content = mixed { sup* & number* & acronym* & warning* } @@ -951,7 +958,7 @@ foreign = element foreign { foreign.attributes, foreign.content } foreign.attributes = - lang.attribute? + lang.attribute? foreign.content = inlines @@ -960,8 +967,8 @@ date = element date { date.attributes, date.content } date.attributes = - date.value.attribute - & date.of.attribute? + date.value.attribute + & date.of.attribute? date.value.attribute = attribute value { xsd:date | xsd:gYearMonth | xsd:gYear } date.of.attribute = attribute of { "birth" | "death" } @@ -973,22 +980,22 @@ math = element math { math.attributes, math.content } math.attributes = - xmlid.attribute? - & math.display.attribute? - & math.type.attribute? -math.display.attribute = attribute display { - "wide" | "numbered" | "box" | "numbered-box" } + xmlid.attribute? + & math.display.attribute? + & math.type.attribute? +math.display.attribute = + attribute display { "wide" | "numbered" | "box" | "numbered-box" } math.type.attribute = attribute type { xsd:NCName } math.content = - mixed { sup* & sub* & var* & warning* } - | (preambule?, latex) + mixed { sup* & sub* & var* & warning* } + | (preambule?, latex) # ~~~~~~ latex latex = element latex { latex.attributes, latex.content } latex.attributes = - plain.attritute? + plain.attritute? plain.attritute = attribute plain { xsd:boolean } latex.content = text @@ -1013,7 +1020,7 @@ quote = element quote { quote.content } quote.content = - (phrase, attribution) | inlines + (phrase, attribution) | inlines phrase = element phrase { phrase.content } @@ -1024,8 +1031,8 @@ initial = element initial { initial.content } initial.content = - initial.c, - initial.w? + initial.c, + initial.w? initial.c = element c { text } initial.w = element w { inlines } @@ -1035,12 +1042,12 @@ note = element note { note.attributes, note.content } note.attributes = - note.label.attribute? + note.label.attribute? note.label.attribute = attribute label { text } note.content = - (note.w?, block+) - | inlines + (note.w?, block+) + | inlines note.w = element w { inlines } @@ -1049,7 +1056,7 @@ link = element link { link.attributes, link.content } link.attributes = - (uri.attribute | idref.attribute) + (uri.attribute | idref.attribute) uri.attribute = attribute uri { xsd:anyURI } idref.attribute = attribute idref { xsd:IDREF } @@ -1060,7 +1067,7 @@ anchor = element anchor { anchor.attributes, anchor.content } anchor.attributes = - anchor.id.attribute + anchor.id.attribute anchor.id.attribute = attribute xml:id { xsd:ID } anchor.content = simple.inlines @@ -1070,7 +1077,7 @@ gloss = element gloss { gloss.attributes, gloss.content } gloss.attributes = - gloss.ref.attribute + gloss.ref.attribute gloss.ref.attribute = attribute ref { xsd:NCName } gloss.content = simple.inlines @@ -1080,9 +1087,9 @@ smil = element smil { smil.attributes, smil.content } smil.attributes = - audio.attribute? - & begin.attribute? - & end.attribute? + audio.attribute? + & begin.attribute? + & end.attribute? audio.attribute = attribute audio { xsd:anyURI } begin.attribute = attribute begin { xsd:decimal } end.attribute = attribute end { xsd:decimal } @@ -1100,7 +1107,7 @@ warning = element warning { warning.attributes, warning.content } warning.attributes = - warning.type.attribute? + warning.type.attribute? warning.type.attribute = attribute type { xsd:NCName } warning.content = inlines diff -r e415b3d474a1 -r 6c30a3543cd8 RelaxNG/publiquiz.rnc --- a/RelaxNG/publiquiz.rnc sam. déc. 01 08:49:14 2018 +0100 +++ b/RelaxNG/publiquiz.rnc dim. janv. 20 16:50:11 2019 +0100 @@ -1,76 +1,66 @@ -include "publidoc.rnc" { - start = publiquiz +include "publidoc.rnc" + { + start = publiquiz - document.content = - top.head?, - (division | topic | quiz)+ + document.content = + document.head?, + (division | document.topic | document.quiz)+ - division.content = - division.head?, - front?, - (division | topic | quiz)+ + division.content = + division.head?, + front?, + (division | document.topic | document.quiz)+ - nowrap.content = - inlines | blanks.inlines | blanks-m.inlines | blanks-c.inlines - | pointing.inlines -} + nowrap.content = + inlines | blanks.inlines | blanks-m.inlines | blanks-c.inlines + | pointing.inlines + } -publiquiz = element publiquiz { - publiquiz.attributes, - publiquiz.content -} +publiquiz = + element publiquiz { + publiquiz.attributes, + publiquiz.content + } publiquiz.attributes = - version.attribute + version.attribute publiquiz.content = - document - | top.quiz + document + | quiz # ============================================================================= -# TOP LEVEL +# QUIZ # ============================================================================= -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ top.quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +quiz = element quiz { quiz.attributes, quiz.content } +document.quiz = element quiz { document.quiz.attributes, document.quiz.content } -top.quiz = element quiz { top.quiz.attributes, top.quiz.content } - -top.quiz.attributes = - quiz.id.attribute? - & quiz.type.attribute? - & lang.attribute? +quiz.attributes = + quiz.id.attribute? + & quiz.type.attribute? + & lang.attribute? +document.quiz.attributes = + (quiz.id.attribute | xmlid.attribute)? + & quiz.type.attribute? + & lang.attribute? quiz.id.attribute = attribute id { xsd:NMTOKEN } quiz.type.attribute = attribute type { xsd:NCName } -top.quiz.content = - top.head?, - instructions?, - (engine | composite), - help?, - answer? - - -# ============================================================================= -# COMPONENT LEVEL -# ============================================================================= - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ quiz ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -quiz = element quiz { quiz.attributes, quiz.content } - -quiz.attributes = - (quiz.id.attribute | xmlid.attribute)? - & quiz.type.attribute? - & lang.attribute? - quiz.content = - component.head?, - instructions?, - (engine | composite), - help?, - answer? + component.head?, + instructions?, + (engine | composite), + help?, + answer? +document.quiz.content = + document.component.head?, + instructions?, + (engine | composite), + help?, + answer? # ============================================================================= @@ -80,30 +70,30 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ section ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks.section = element section { section.attributes, blanks.section.content } -blanks-m.section = element section { - section.attributes, blanks-m.section.content } -blanks-c.section = element section { - section.attributes, blanks-c.section.content } -correct.section = element section { - section.attributes, correct.section.content } -pointing.section = element section { - section.attributes, pointing.section.content } +blanks-m.section = + element section { section.attributes, blanks-m.section.content } +blanks-c.section = + element section { section.attributes, blanks-c.section.content } +correct.section = + element section { section.attributes, correct.section.content } +pointing.section = + element section { section.attributes, pointing.section.content } blanks.section.content = - section.head?, - (blanks.section+ | blanks.block+) + section.head?, + (blanks.section+ | blanks.block+) blanks-m.section.content = - section.head?, - (blanks-m.section+ | blanks-m.block+) + section.head?, + (blanks-m.section+ | blanks-m.block+) blanks-c.section.content = - section.head?, - (blanks-c.section+ | blanks-c.block+) + section.head?, + (blanks-c.section+ | blanks-c.block+) correct.section.content = - section.head?, - (correct.section+ | correct.block+) + section.head?, + (correct.section+ | correct.block+) pointing.section.content = - section.head?, - (pointing.section+ | pointing.block+) + section.head?, + (pointing.section+ | pointing.block+) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ instructions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -112,66 +102,66 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine = - choices-radio - | choices-check - | blanks-fill - | blanks-select - | blanks-media - | blanks-choices - | correct-line - | pointing - | pointing-categories - | matching - | sort - | categories - | wordsearch - | flashcard - | coloring - | memory - | dictation - | production + choices-radio + | choices-check + | blanks-fill + | blanks-select + | blanks-media + | blanks-choices + | correct-line + | pointing + | pointing-categories + | matching + | sort + | categories + | wordsearch + | flashcard + | coloring + | memory + | dictation + | production # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -choices-radio = element choices-radio { - choices-radio.attributes, choices-radio.content } -choices-check = element choices-check { - choices-check.attributes, choices-check.content } +choices-radio = + element choices-radio { choices-radio.attributes, choices-radio.content } +choices-check = + element choices-check { choices-check.attributes, choices-check.content } choices-radio.attributes = - shuffle.attribute? + shuffle.attribute? choices-check.attributes = - success.attribute? - & shuffle.attribute? + success.attribute? + & shuffle.attribute? success.attribute = attribute success { xsd:decimal {maxInclusive="1"} } shuffle.attribute = attribute shuffle { xsd:boolean } choices-radio.content = - choices.right - & choices.wrong+ + choices.right + & choices.wrong+ choices-check.content = - (choices.right | choices.wrong)+ + (choices.right | choices.wrong)+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -blanks-fill = element blanks-fill { - blanks-fill.attributes, blanks-fill.content } -blanks-select = element blanks-select { - blanks-select.attributes, blanks-select.content } -blanks-media = element blanks-media { - blanks-select.attributes, blanks-media.content } -blanks-choices = element blanks-choices { - blanks-choices.content } +blanks-fill = + element blanks-fill { blanks-fill.attributes, blanks-fill.content } +blanks-select = + element blanks-select { blanks-select.attributes, blanks-select.content } +blanks-media = + element blanks-media { blanks-select.attributes, blanks-media.content } +blanks-choices = + element blanks-choices { blanks-choices.content } blanks-fill.attributes = - success.attribute? - & strict.attribute? - & long.attribute? + success.attribute? + & strict.attribute? + & long.attribute? blanks-select.attributes = - success.attribute? - & multiple.attribute? - & noshuffle.attribute? - & orientation.attribute? + success.attribute? + & multiple.attribute? + & noshuffle.attribute? + & orientation.attribute? strict.attribute = attribute strict { xsd:boolean } multiple.attribute = attribute multiple { xsd:boolean } noshuffle.attribute = attribute no-shuffle { "true" | "false" | "alpha" } @@ -179,73 +169,73 @@ orientation.attribute = attribute orientation {"north"|"east"|"west"|"south"} blanks-fill.content = - (blanks.block+ | blanks.section+) + (blanks.block+ | blanks.section+) blanks-select.content = - blanks.intruders?, - (blanks.block+ | blanks.section+) + blanks.intruders?, + (blanks.block+ | blanks.section+) blanks-media.content = - blanks-m.intruders?, - (blanks-m.block+ | blanks-m.section+) + blanks-m.intruders?, + (blanks-m.block+ | blanks-m.section+) blanks-choices.content = - (blanks-c.block+ | blanks-c.section+) + (blanks-c.block+ | blanks-c.section+) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ correct-line ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ correct-line = element correct-line { correct.attributes, correct.content } correct.attributes = - remove-space.attribute? + remove-space.attribute? remove-space.attribute = attribute remove-space { xsd:boolean } correct.content = - correct.intruders?, - (correct.block+ | correct.section+) + correct.intruders?, + (correct.block+ | correct.section+) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing = element pointing { pointing.attributes, pointing.content } pointing.attributes = - success.attribute? - & pointing.type.attribute? + success.attribute? + & pointing.type.attribute? pointing.type.attribute = attribute type { "radio" | "check" } pointing.content = - (pointing.section+ | pointing.block+) + (pointing.section+ | pointing.block+) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ pointing-categories ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ pointing-categories -pointing-categories = element pointing-categories { - pointing-c.attributes, pointing-c.content } +pointing-categories = + element pointing-categories { pointing-c.attributes, pointing-c.content } pointing-c.attributes = - success.attribute? + success.attribute? pointing-c.content = - pointing-c.categories, - pointing.section + pointing-c.categories, + pointing.section # ~~~~~~ pointing-c.categories pointing-c.categories = element categories { pointing-c.categories.content } pointing-c.categories.content = - pointing-c.category1, - pointing-c.category2, - (pointing-c.category3, - (pointing-c.category4, pointing-c.category5?)?)? + pointing-c.category1, + pointing-c.category2, + (pointing-c.category3, + (pointing-c.category4, pointing-c.category5?)?)? # ~~~~~~ pointing-c.categoryN -pointing-c.category1 = element category { - attribute id { "1" }, pointing-c.category.content } -pointing-c.category2 = element category { - attribute id { "2" }, pointing-c.category.content } -pointing-c.category3 = element category { - attribute id { "3" }, pointing-c.category.content } -pointing-c.category4 = element category { - attribute id { "4" }, pointing-c.category.content } -pointing-c.category5 = element category { - attribute id { "5" }, pointing-c.category.content } +pointing-c.category1 = + element category { attribute id { "1" }, pointing-c.category.content } +pointing-c.category2 = + element category { attribute id { "2" }, pointing-c.category.content } +pointing-c.category3 = + element category { attribute id { "3" }, pointing-c.category.content } +pointing-c.category4 = + element category { attribute id { "4" }, pointing-c.category.content } +pointing-c.category5 = + element category { attribute id { "5" }, pointing-c.category.content } pointing-c.category.content = inlines @@ -255,31 +245,31 @@ matching = element matching { matching.attributes, matching.content } matching.attributes = - success.attribute? - & multiple.attribute? - & noshuffle.attribute? - & orientation.attribute? + success.attribute? + & multiple.attribute? + & noshuffle.attribute? + & orientation.attribute? matching.content = - matching.intruders?, - match, - match+ + matching.intruders?, + match, + match+ # ~~~~~~ match match = element match { match.content } match.content = - match.item, - match.item + match.item, + match.item # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sort = element sort { sort.attributes, sort.content } sort.attributes = - success.attribute? - & shuffle.attribute? - & orientation.attribute? + success.attribute? + & shuffle.attribute? + & orientation.attribute? sort.content = sort.intruders?, @@ -293,44 +283,44 @@ category.head = element head { category.head.content } category.head.content = - title - & shorttitle? - & subtitle* + title + & shorttitle? + & subtitle* # ~~~~~~ categories categories = element categories { categories.attributes, categories.content } categories.attributes = - success.attribute? - & multiple.attribute? - & noshuffle.attribute? - & orientation.attribute? + success.attribute? + & multiple.attribute? + & noshuffle.attribute? + & orientation.attribute? categories.content = - categories.intruders?, - category, - category+ + categories.intruders?, + category, + category+ # ~~~~~~ category category = element category { category.content } category.content = - category.head, - category.item* + category.head, + category.item* # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ wordsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ wordsearch = element wordsearch {wordsearch.attributes, wordsearch.content } wordsearch.attributes = - strict.attribute ? - & wordlist.attribute ? + strict.attribute ? + & wordlist.attribute ? wordlist.attribute = attribute wordlist { "hidden" | "right" | "left" } wordsearch.content = - words - & grid + words + & grid # ~~~~~~ words words = element words {words.content} @@ -352,8 +342,8 @@ flashcard = element flashcard { flashcard.content } flashcard.content = - side1, - side2 + side1, + side2 # ~~~~~~ side1 side1 = element side1 { side1.content } @@ -388,8 +378,8 @@ coloring.content = palette - & canvas - & areas? + & canvas + & areas? # ~~~~~~ palette palette = element palette { palette.content } @@ -421,8 +411,8 @@ delay.attribute = attribute delay { xsd:positiveInteger } memory.content = - memory.match, - memory.match+ + memory.match, + memory.match+ # ~~~~~~ memory.match memory.match = element match { memory-m.content } @@ -456,38 +446,38 @@ composite = element composite { composite.attributes, composite.content } composite.attributes = - success.attribute? - & multipage.attribute? + success.attribute? + & multipage.attribute? multipage.attribute = attribute multipage { xsd:boolean } composite.content = - subquiz, - subquiz+ + subquiz, + subquiz+ # ~~~~~~ subquiz subquiz = element subquiz { subquiz.content } subquiz.content = - instructions?, - engine, - help?, - answer? + instructions?, + engine, + help?, + answer? # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ help = element help { help.content } help.content = - (section+ | block+)?, - link* + (section+ | block+)?, + link* # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ answer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ answer = element answer { answer.content } answer.content = - (section+ | block+)?, - link* + (section+ | block+)?, + link* # ============================================================================= @@ -496,21 +486,21 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -blanks.block = ( - blanks.p | blanks.list | blanks.blockquote | blanks.speech | blanks.table - | blanks.media) -blanks-m.block = ( - blanks-m.p | blanks-m.list | blanks-m.blockquote | blanks-m.speech - | blanks-m.table | blanks-m.media) -blanks-c.block = ( - blanks-c.p | blanks-c.list | blanks-c.blockquote | blanks-c.speech - | blanks-c.table | blanks-c.media) -correct.block = ( - correct.p | correct.list | correct.blockquote | correct.speech - | correct.table | media) -pointing.block = ( - pointing.p | pointing.list | pointing.blockquote | pointing.speech - | pointing.table | media) +blanks.block = + (blanks.p | blanks.list | blanks.blockquote | blanks.speech | blanks.table + | blanks.media) +blanks-m.block = + (blanks-m.p | blanks-m.list | blanks-m.blockquote | blanks-m.speech + | blanks-m.table | blanks-m.media) +blanks-c.block = + (blanks-c.p | blanks-c.list | blanks-c.blockquote | blanks-c.speech + | blanks-c.table | blanks-c.media) +correct.block = + (correct.p | correct.list | correct.blockquote | correct.speech + | correct.table | media) +pointing.block = + (pointing.p | pointing.list | pointing.blockquote | pointing.speech + | pointing.table | media) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -537,31 +527,31 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ list -blanks.list = element list { - block.head?, - ( (attribute type {"ordered"}?, blanks.item, blanks.item+) - | (attribute type {"glossary"}, item.glossary+) ) -} -blanks-m.list = element list { - block.head?, - ( (attribute type {"ordered"}?, blanks-m.item, blanks-m.item+) - | (attribute type {"glossary"}, item.glossary+) ) -} -blanks-c.list = element list { - block.head?, - ( (attribute type {"ordered"}?, blanks.item, blanks.item+) - | (attribute type {"glossary"}, item.glossary+) ) -} -correct.list = element list { - block.head?, - ( (attribute type {"ordered"}?, correct.item, correct.item+) - | (attribute type {"glossary"}, item.glossary+) ) -} -pointing.list = element list { - block.head?, - ( (attribute type {"ordered"}?, pointing.item, pointing.item+) - | (attribute type {"glossary"}, item.glossary+) ) -} +blanks.list = + element list { + block.head?, + ( (attribute type {"ordered"}?, blanks.item, blanks.item+) | + (attribute type {"glossary"}, item.glossary+) ) } +blanks-m.list = + element list { + block.head?, + ( (attribute type {"ordered"}?, blanks-m.item, blanks-m.item+) | + (attribute type {"glossary"}, item.glossary+) ) } +blanks-c.list = + element list { + block.head?, + ( (attribute type {"ordered"}?, blanks.item, blanks.item+) | + (attribute type {"glossary"}, item.glossary+) ) } +correct.list = + element list { + block.head?, + ( (attribute type {"ordered"}?, correct.item, correct.item+) | + (attribute type {"glossary"}, item.glossary+) ) } +pointing.list = + element list { + block.head?, + ( (attribute type {"ordered"}?, pointing.item, pointing.item+) | + (attribute type {"glossary"}, item.glossary+) ) } # ~~~~~~ item blanks.item = element item { blanks.item.content } @@ -579,37 +569,37 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blockquote ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -blanks.blockquote = element blockquote { - blockquote.attributes, blanks.blockquote.content } -blanks-m.blockquote = element blockquote { - blockquote.attributes, blanks-m.blockquote.content } -blanks-c.blockquote = element blockquote { - blockquote.attributes, blanks-c.blockquote.content } -correct.blockquote = element blockquote { - blockquote.attributes, correct.blockquote.content } -pointing.blockquote = element blockquote { - blockquote.attributes, pointing.blockquote.content } +blanks.blockquote = + element blockquote { blockquote.attributes, blanks.blockquote.content } +blanks-m.blockquote = + element blockquote { blockquote.attributes, blanks-m.blockquote.content } +blanks-c.blockquote = + element blockquote { blockquote.attributes, blanks-c.blockquote.content } +correct.blockquote = + element blockquote { blockquote.attributes, correct.blockquote.content } +pointing.blockquote = + element blockquote { blockquote.attributes, pointing.blockquote.content } blanks.blockquote.content = - block.head?, - (blanks.p | speech | blanks.list)+, - attribution? + block.head?, + (blanks.p | speech | blanks.list)+, + attribution? blanks-m.blockquote.content = - block.head?, - (blanks-m.p | speech | blanks-m.list)+, - attribution? + block.head?, + (blanks-m.p | speech | blanks-m.list)+, + attribution? blanks-c.blockquote.content = - block.head?, - (blanks-c.p | speech | blanks-c.list)+, - attribution? + block.head?, + (blanks-c.p | speech | blanks-c.list)+, + attribution? correct.blockquote.content = - block.head?, - (correct.p | speech | correct.list)+, - attribution? + block.head?, + (correct.p | speech | correct.list)+, + attribution? pointing.blockquote.content = - block.head?, - (pointing.p | speech | pointing.list)+, - attribution? + block.head?, + (pointing.p | speech | pointing.list)+, + attribution? # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -621,25 +611,25 @@ pointing.speech = element speech { pointing.speech.content } blanks.speech.content = - blanks.speaker?, - stage?, - (blanks.p | blanks.blockquote)+ + blanks.speaker?, + stage?, + (blanks.p | blanks.blockquote)+ blanks-m.speech.content = - blanks-m.speaker?, - stage?, - (blanks-m.p | blanks-m.blockquote)+ + blanks-m.speaker?, + stage?, + (blanks-m.p | blanks-m.blockquote)+ blanks-c.speech.content = - blanks-c.speaker?, - stage?, - (blanks-c.p | blanks-c.blockquote)+ + blanks-c.speaker?, + stage?, + (blanks-c.p | blanks-c.blockquote)+ correct.speech.content = - correct.speaker?, - stage?, - (correct.p | correct.blockquote)+ + correct.speaker?, + stage?, + (correct.p | correct.blockquote)+ pointing.speech.content = - pointing.speaker?, - stage?, - (pointing.p | pointing.blockquote)+ + pointing.speaker?, + stage?, + (pointing.p | pointing.blockquote)+ # ~~~~~~ speaker blanks.speaker = element speaker { blanks.speaker.content } @@ -664,25 +654,25 @@ pointing.table = element table { table.attributes, pointing.table.content } blanks.table.content = - block.head?, - ((thead?, blanks.tbody+) | blanks.tr+), - blanks.table.caption? + block.head?, + ((thead?, blanks.tbody+) | blanks.tr+), + blanks.table.caption? blanks-m.table.content = - block.head?, - ((thead?, blanks-m.tbody+) | blanks-m.tr+), - blanks-m.table.caption? + block.head?, + ((thead?, blanks-m.tbody+) | blanks-m.tr+), + blanks-m.table.caption? blanks-c.table.content = - block.head?, - ((thead?, blanks-c.tbody+) | blanks-c.tr+), - blanks-c.table.caption? + block.head?, + ((thead?, blanks-c.tbody+) | blanks-c.tr+), + blanks-c.table.caption? correct.table.content = - block.head?, - ((thead?, correct.tbody+) | correct.tr+), - correct.table.caption? + block.head?, + ((thead?, correct.tbody+) | correct.tr+), + correct.table.caption? pointing.table.content = - block.head?, - ((thead?, pointing.tbody+) | pointing.tr+), - pointing.table.caption? + block.head?, + ((thead?, pointing.tbody+) | pointing.tr+), + pointing.table.caption? # ~~~~~~ tbody blanks.tbody = element tbody { blanks.tbody.content } @@ -692,15 +682,15 @@ pointing.tbody = element tbody { pointing.tbody.content } blanks.tbody.content = - blanks.tr+ + blanks.tr+ blanks-m.tbody.content = - blanks-m.tr+ + blanks-m.tr+ blanks-c.tbody.content = - blanks-c.tr+ + blanks-c.tr+ correct.tbody.content = - correct.tr+ + correct.tr+ pointing.tbody.content = - pointing.tr+ + pointing.tr+ # ~~~~~~ tr blanks.tr = element tr { tr.attributes, blanks.tr.content } @@ -710,15 +700,15 @@ pointing.tr = element tr { tr.attributes, pointing.tr.content } blanks.tr.content = - (blanks.td | blanks.th)+ + (blanks.td | blanks.th)+ blanks-m.tr.content = - (blanks-m.td | blanks-m.th)+ + (blanks-m.td | blanks-m.th)+ blanks-c.tr.content = - (blanks-c.td | blanks-c.th)+ + (blanks-c.td | blanks-c.th)+ correct.tr.content = - (correct.td | correct.th)+ + (correct.td | correct.th)+ pointing.tr.content = - (pointing.td | pointing.th)+ + (pointing.td | pointing.th)+ # ~~~~~~ td, th blanks.td = element td { td.attributes, blanks.td.content } @@ -733,20 +723,20 @@ pointing.th = element th { td.attributes, pointing.td.content } blanks.td.content = - blanks.inlines - | (blanks.p | blanks.media)+ + blanks.inlines + | (blanks.p | blanks.media)+ blanks-m.td.content = - blanks-m.inlines - | (blanks-m.p | blanks-m.media)+ + blanks-m.inlines + | (blanks-m.p | blanks-m.media)+ blanks-c.td.content = - blanks-c.inlines - | (blanks-c.p | blanks-c.media)+ + blanks-c.inlines + | (blanks-c.p | blanks-c.media)+ correct.td.content = - correct.inlines - | (correct.p | media)+ + correct.inlines + | (correct.p | media)+ pointing.td.content = - pointing.inlines - | (pointing.p | media)+ + pointing.inlines + | (pointing.p | media)+ # ~~~~~~ table.caption blanks.table.caption = element caption { blanks.caption.content } @@ -756,20 +746,20 @@ pointing.table.caption = element caption { pointing.caption.content } blanks.caption.content = - blanks.inlines - | (blanks.p | speech | blanks.list | blockquote)+ + blanks.inlines + | (blanks.p | speech | blanks.list | blockquote)+ blanks-m.caption.content = - blanks-m.inlines - | (blanks-m.p | speech | blanks-m.list | blockquote)+ + blanks-m.inlines + | (blanks-m.p | speech | blanks-m.list | blockquote)+ blanks-c.caption.content = - blanks-c.inlines - | (blanks-c.p | speech | blanks-c.list | blockquote)+ + blanks-c.inlines + | (blanks-c.p | speech | blanks-c.list | blockquote)+ correct.caption.content = - correct.inlines - | (correct.p | speech | correct.list | blockquote)+ + correct.inlines + | (correct.p | speech | correct.list | blockquote)+ pointing.caption.content = - pointing.inlines - | (pointing.p | speech | pointing.list | blockquote)+ + pointing.inlines + | (pointing.p | speech | pointing.list | blockquote)+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -782,75 +772,75 @@ dictation.media = element media { media.attributes, dictation.media.content } blanks.media.content = - block.head?, - (blanks.image | audio | video)+, - blanks.media.caption?, - link? + block.head?, + (blanks.image | audio | video)+, + blanks.media.caption?, + link? blanks-m.media.content = - block.head?, - (blanks-m.image | audio | video)+, - blanks-m.media.caption?, - link? + block.head?, + (blanks-m.image | audio | video)+, + blanks-m.media.caption?, + link? blanks-c.media.content = - block.head?, - (image | audio | video)+, - blanks-c.media.caption?, - link? + block.head?, + (image | audio | video)+, + blanks-c.media.caption?, + link? correct.media.content = - block.head?, - (image | audio | video)+, - correct.media.caption?, - link? + block.head?, + (image | audio | video)+, + correct.media.caption?, + link? pointing.media.content = - block.head?, - (image | audio | video)+, - pointing.media.caption?, - link? + block.head?, + (image | audio | video)+, + pointing.media.caption?, + link? dictation.media.content = - audio + audio # ~~~~~~ blanks.image blanks.image = element image { image.attributes, blanks.image.content } blanks-m.image = element image { image.attributes, blanks-m.image.content } blanks.image.content = - copyright?, - blanks.dropzone* + copyright?, + blanks.dropzone* blanks-m.image.content = - copyright?, - blanks-m.dropzone* + copyright?, + blanks-m.dropzone* # ~~~~~~ dropzone -blanks.dropzone = element dropzone { - blanks.dropzone.attributes, blanks.dropzone.content } -blanks-m.dropzone = element dropzone { - blanks-m.dropzone.attributes, blanks-m.dropzone.content } +blanks.dropzone = + element dropzone { blanks.dropzone.attributes, blanks.dropzone.content } +blanks-m.dropzone = + element dropzone { blanks-m.dropzone.attributes, blanks-m.dropzone.content } blanks.dropzone.attributes = - x.attribute - & y.attribute + x.attribute + & y.attribute blanks-m.dropzone.attributes = - x.attribute - & y.attribute - & h.attribute - & w.attribute + x.attribute + & y.attribute + & h.attribute + & w.attribute blanks.dropzone.content = - blank + blank blanks-m.dropzone.content = - blank-m + blank-m # ~~~~~~ media.caption -blanks.media.caption = element caption { - caption.attributes, blanks.caption.content } -blanks-m.media.caption = element caption { - caption.attributes, blanks-m.caption.content } -blanks-c.media.caption = element caption { - caption.attributes, blanks-c.caption.content } -correct.media.caption = element caption { - caption.attributes, correct.caption.content } -pointing.media.caption = element caption { - caption.attributes, pointing.caption.content } +blanks.media.caption = + element caption { caption.attributes, blanks.caption.content } +blanks-m.media.caption = + element caption { caption.attributes, blanks-m.caption.content } +blanks-c.media.caption = + element caption { caption.attributes, blanks-c.caption.content } +correct.media.caption = + element caption { caption.attributes, correct.caption.content } +pointing.media.caption = + element caption { caption.attributes, pointing.caption.content } # ~~~~~~~~~~~~~~~~~~~~~~~~ choices.right, choices.wrong ~~~~~~~~~~~~~~~~~~~~~~~ @@ -858,8 +848,8 @@ choices.wrong = element wrong { choices.right.content } choices.right.content = - inlines - | ((p | image | (audio, image?) | video), help?, answer?) + inlines + | ((p | image | (audio, image?) | video), help?, answer?) # ~~~~~~~~~~~~~~~~~~~~ blanks.intruders, blanks-m.intruders ~~~~~~~~~~~~~~~~~~ @@ -881,14 +871,14 @@ matching.intruders = element intruders { matching.intruders.content } matching.intruders.content = - match.item+ + match.item+ # ~~~~~~~ match.item match.item = element item { match.item.content } match.item.content = - inlines - | (p, help?, answer?) + inlines + | (p, help?, answer?) # ~~~~~~~~~~~~~~~~~~~~ sort.intruders, comparison, sort.item ~~~~~~~~~~~~~~~~~~ @@ -896,7 +886,7 @@ sort.intruders = element intruders { sort.intruders.content } sort.intruders.content = - sort.item+ + sort.item+ # ~~~~~~ comparison comparison = element comparison { comparison.content } @@ -907,12 +897,12 @@ sort.item = element item { sort.item.attributes, sort.item.content } sort.item.attributes = - item.shuffle.attribute? + item.shuffle.attribute? item.shuffle.attribute = attribute shuffle { xsd:integer } sort.item.content = - inlines - | (p, help?, answer?) + inlines + | (p, help?, answer?) # ~~~~~~~~~~~~~~~~~~~~~ categories.intruders, category.item ~~~~~~~~~~~~~~~~~~~ @@ -920,14 +910,14 @@ categories.intruders = element intruders { categories.intruders.content } categories.intruders.content = - category.item+ + category.item+ # ~~~~~~ category.item category.item = element item { category.item.content } category.item.content = - inlines - | (p, help?, answer?) + inlines + | (p, help?, answer?) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ words.item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ words.item = element item {words.item.content, words.item.attributes } @@ -935,10 +925,10 @@ words.item.content = inlines words.item.attributes = - startx - & starty - & endx - & endy + startx + & starty + & endx + & endy startx = attribute startx {xsd:token {pattern = "[a-zA-Z]+"}} starty = attribute starty {xsd:token {pattern = "\d+"}} @@ -968,170 +958,167 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -blanks.inlines = mixed { - sup* - & sub* - & var* - & number* - & acronym* - & warning* +blanks.inlines = + mixed { + sup* & sub* + & var* + & number* + & acronym* + & warning* - & highlight* - & emphasis* - & mentioned* - & literal* - & term* - & stage* - & name* - & foreign* - & date* - & math* - & quote* - & initial* - & note* - & link* - & anchor* - & index* - & image* - & audio* - & smil* - & nowrap* + & highlight* + & emphasis* + & mentioned* + & literal* + & term* + & stage* + & name* + & foreign* + & date* + & math* + & quote* + & initial* + & note* + & link* + & anchor* + & index* + & image* + & audio* + & smil* + & nowrap* - & blank* -} + & blank* + } -blanks-m.inlines = mixed { - sup* - & sub* - & var* - & number* - & acronym* - & warning* +blanks-m.inlines = + mixed { + sup* & sub* + & var* + & number* + & acronym* + & warning* - & highlight* - & emphasis* - & mentioned* - & literal* - & term* - & stage* - & name* - & foreign* - & date* - & math* - & quote* - & initial* - & note* - & link* - & anchor* - & index* - & image* - & audio* - & smil* - & nowrap* + & highlight* + & emphasis* + & mentioned* + & literal* + & term* + & stage* + & name* + & foreign* + & date* + & math* + & quote* + & initial* + & note* + & link* + & anchor* + & index* + & image* + & audio* + & smil* + & nowrap* - & blank-m* -} + & blank-m* + } -blanks-c.inlines = mixed { - sup* - & sub* - & var* - & number* - & acronym* - & warning* +blanks-c.inlines = + mixed { + sup* & sub* + & var* + & number* + & acronym* + & warning* - & highlight* - & emphasis* - & mentioned* - & literal* - & term* - & stage* - & name* - & foreign* - & date* - & math* - & quote* - & initial* - & note* - & link* - & anchor* - & index* - & image* - & audio* - & smil* - & nowrap* + & highlight* + & emphasis* + & mentioned* + & literal* + & term* + & stage* + & name* + & foreign* + & date* + & math* + & quote* + & initial* + & note* + & link* + & anchor* + & index* + & image* + & audio* + & smil* + & nowrap* - & blank-c* -} + & blank-c* + } -correct.inlines = mixed { - sup* - & sub* - & var* - & number* - & acronym* - & warning* +correct.inlines = + mixed { + sup* & sub* + & var* + & number* + & acronym* + & warning* - & highlight* - & emphasis* - & mentioned* - & literal* - & term* - & stage* - & name* - & foreign* - & date* - & math* - & quote* - & initial* - & note* - & link* - & anchor* - & index* - & image* - & audio* - & smil* - & nowrap* + & highlight* + & emphasis* + & mentioned* + & literal* + & term* + & stage* + & name* + & foreign* + & date* + & math* + & quote* + & initial* + & note* + & link* + & anchor* + & index* + & image* + & audio* + & smil* + & nowrap* - & char* -} + & char* + } -pointing.inlines = mixed { - sup* - & sub* - & var* - & number* - & acronym* - & warning* +pointing.inlines = + mixed { + sup* & sub* + & var* + & number* + & acronym* + & warning* - & highlight* - & emphasis* - & mentioned* - & literal* - & term* - & stage* - & name* - & foreign* - & date* - & math* - & quote* - & initial* - & note* - & link* - & anchor* - & index* - & image* - & audio* - & smil* - & nowrap* + & highlight* + & emphasis* + & mentioned* + & literal* + & term* + & stage* + & name* + & foreign* + & date* + & math* + & quote* + & initial* + & note* + & link* + & anchor* + & index* + & image* + & audio* + & smil* + & nowrap* - & point* -} + & point* + } -dictation.inlines = mixed { - warning* - & dictation.hint* -} +dictation.inlines = mixed { warning* & dictation.hint* } # ~~~~~~~~~~~~~~~~~~~~~~~~~~ blank, blank-m, blank-c ~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1139,22 +1126,22 @@ blank = element blank { blank.attributes, blank.content } blank.attributes = - area.attribute? - & long.attribute? + area.attribute? + & long.attribute? area.attribute = attribute area { xsd:boolean } blank.content = - text - | (s+, help?, answer?) + text + | (s+, help?, answer?) # ~~~~~~ blank-m blank-m = element blank { blank-m.content } blank-m.content = - p - | math - | image - | audio - | (s-m+, help?, answer?) + p + | math + | image + | audio + | (s-m+, help?, answer?) # ~~~~~~ blank-c blank-c = element blank { blank-c.attributes, blank-c.content } @@ -1173,10 +1160,10 @@ # ~~~~~~ s-m s-m = element s { s-m.content } s-m.content = - p - | math - | image - | audio + p + | math + | image + | audio # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ char ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1192,10 +1179,10 @@ point = element point { point.attributes, point.content } point.attributes = - point.ref.attribute? + point.ref.attribute? -point.ref.attribute = attribute ref { - "right" | "cat1" | "cat2" | "cat3" | "cat4" | "cat5" } +point.ref.attribute = + attribute ref { "right" | "cat1" | "cat2" | "cat3" | "cat4" | "cat5" } point.content = inlines @@ -1215,7 +1202,7 @@ mistake = element mistake { mistake.attributes, mistake.content } mistake.attributes = - mistake.is.attribute? + mistake.is.attribute? mistake.is.attribute = attribute is { text } mistake.content = inlines