diff -r adde3c1288f2 -r 32381a87f807 RelaxNG/publidoc.rnc --- a/RelaxNG/publidoc.rnc mar. sept. 13 10:24:30 2011 +0200 +++ b/RelaxNG/publidoc.rnc mar. sept. 27 17:12:04 2011 +0200 @@ -306,7 +306,7 @@ block = (p | speech | \list | table | media) -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ p = element p { p.content } @@ -458,7 +458,9 @@ inlines = mixed { sup* & sub* + & var* & number* + & math* & date* & name* & note* @@ -469,13 +471,30 @@ & acronym* & term* & link* + & anchor* } -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sub, sup, var ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -sup = element sup { inlines } +sup = element sup { text } -sub = element sub { inlines } +sub = element sub { text } + +var = element var { text } + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ math ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +math = element math { + ( attribute notation {"tex"}, math.attributes, math.tex.content ) + | ( math.attributes, math.content) +} + +math.attributes = + wide.attribute? +wide.attribute = attribute wide { xsd:boolean } + +math.content = mixed { sup* & sub* & var* } +math.tex.content = text # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ number ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -570,9 +589,23 @@ link = element link { link.attributes, link.content } link.attributes = - uri.attribute - | idref.attribute + (uri.attribute | idref.attribute) + & anchor.attribute? uri.attribute = attribute uri { xsd:anyURI } idref.attribute = attribute idref { xsd:IDREF } +anchor.attribute = attribute anchor { xsd:NCName } link.content = inlines + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +anchor = element anchor { + ( anchor.attributes, anchor.content ) + | ( attribute startref { xsd:IDREF } ) +} + +anchor.attributes = + anchor.id.attribute +anchor.id.attribute = attribute xml:id { xsd:ID } + +anchor.content = inlines