# HG changeset patch # User Patrick PIERRE # Date 1327271075 -3600 # Node ID 70418017787ef69fe40dcedb0f25a3ddaee4ad1c # Parent ebe0ab8699fc94105d89d7ffc145b16dc12af32e Optimisation pour xmllint diff -r ebe0ab8699fc -r 70418017787e RelaxNG/publidoc.rnc --- a/RelaxNG/publidoc.rnc dim. janv. 22 09:58:59 2012 +0100 +++ b/RelaxNG/publidoc.rnc dim. janv. 22 23:24:35 2012 +0100 @@ -324,12 +324,11 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ list -\list = element list { \list.content } - -\list.content = +\list = element list { block.head?, ( (attribute type {"ordered"}?, item, item+) | (attribute type {"glossary"}, glossary.item+) ) +} # ~~~~~~ item item = element item { item.content } @@ -401,7 +400,7 @@ tbody.attributes = valign.attribute? valign.attribute = attribute valign { "top" | "middle" | "bottom" } - + thead.content = row+ tfoot.content = diff -r ebe0ab8699fc -r 70418017787e RelaxNG/publiquiz.rnc --- a/RelaxNG/publiquiz.rnc dim. janv. 22 09:58:59 2012 +0100 +++ b/RelaxNG/publiquiz.rnc dim. janv. 22 23:24:35 2012 +0100 @@ -9,6 +9,7 @@ (division | topic | quiz)+ } + publiquiz = element publiquiz { publiquiz.attributes, publiquiz.content @@ -79,20 +80,18 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ engine = - choices.radio - | choices.check - | blanks.fill - | blanks.select + choices + | blanks | point | matching | sort # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ choices ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -choices.radio = element choices { - attribute type { "radio" }, choices.attributes, choices.radio.content } -choices.check = element choices { - attribute type { "check" }, choices.attributes, choices.check.content } +choices = element choices { + (attribute type {"radio"}, choices.attributes, choices.radio.content) + | (attribute type {"check"}, choices.attributes, choices.check.content) +} choices.attributes = shuffle.attribute? @@ -106,15 +105,14 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blanks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -blanks.fill = element blanks { blanks.fill.attributes, blanks.fill.content } -blanks.select = element blanks { - blanks.select.attributes, blanks.select.content } +blanks = element blanks { + (attribute type {"fill"}, blanks.fill.attributes, blanks.fill.content) + | (attribute type {"select"}, blanks.select.attributes, blanks.select.content) +} blanks.fill.attributes = - attribute type { "fill" } - & strict.attribute? + strict.attribute? blanks.select.attributes = - attribute type { "select" }, multiple.attribute? strict.attribute = attribute strict { xsd:boolean } multiple.attribute = attribute multiple { xsd:boolean } @@ -128,7 +126,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ point ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ point = element point { point.attributes, point.content } - + point.attributes = point.type.attribute? point.type.attribute = attribute type { @@ -140,7 +138,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ matching ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ matching = element matching { matching.content } - + matching.content = match, match+ @@ -151,7 +149,7 @@ sort.attributes = shuffle.attribute? - + sort.content = comparison?, sort.item, @@ -160,7 +158,7 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composite ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ composite = element composite { composite.content } - + composite.content = (instructions?, engine), (instructions?, engine)+ @@ -198,37 +196,33 @@ point.p = element p { point.p.content } blanks.p.content = - inlines - & blank* + blanks.inlines point.p.content = - inlines - & point.right* - & point.wrong* + point.inlines # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ list -blanks.list = element list { blanks.list.content } -point.list = element list { point.list.content } - -blanks.list.content = +blanks.list = element list { block.head?, ( (attribute type {"ordered"}?, blanks.item, blanks.item+) | (attribute type {"glossary"}, glossary.item+) ) -point.list.content = +} +point.list = element list { block.head?, ( (attribute type {"ordered"}?, point.item, point.item+) | (attribute type {"glossary"}, glossary.item+) ) +} # ~~~~~~ item blanks.item = element item { blanks.item.content } point.item = element item { point.item.content } blanks.item.content = - (inlines & blank*) + blanks.inlines | blanks.block+ point.item.content = - (inlines & point.right* & point.wrong*) + point.inlines | point.block+ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -279,11 +273,11 @@ point.entry = element entry { point.entry.content } blanks.entry.content = - (inlines & blank*) + blanks.inlines | (p | media)+ point.entry.content = - (inlines & point.right* & point.wrong*) + point.inlines | (p | media)+ @@ -318,7 +312,7 @@ (p | section), (p | section) -# ~~~~~~~~~~~~~~~~~~~~~~~~ (sort) comparaison, item ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~~ (sort) comparison, item ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ comparison comparison = element comparison { comparison.content } @@ -339,6 +333,49 @@ # INLINE LEVEL # ============================================================================= +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +blanks.inlines = mixed { + sup* + & sub* + & var* + & number* + & math* + & date* + & name* + & note* + & foreign* + & highlight* + & mentioned* + & quote* + & acronym* + & term* + & link* + & anchor* + & blank* +} +point.inlines = mixed { + sup* + & sub* + & var* + & number* + & math* + & date* + & name* + & note* + & foreign* + & highlight* + & mentioned* + & quote* + & acronym* + & term* + & link* + & anchor* + & blank* + & point.right* + & point.wrong* +} + # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blank ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~ blank