# HG changeset patch # User Patrick PIERRE <patrick.pierre@prismallia.fr> # Date 1317159000 -7200 # Node ID 5be33d03941a62d4f527cd07064239fea4b80e63 # Parent 32381a87f8073754f625b6a91a9a49afece92186 Simplification de <anchor> + <sound> diff -r 32381a87f807 -r 5be33d03941a RelaxNG/publidoc.rnc --- a/RelaxNG/publidoc.rnc mar. sept. 27 17:12:04 2011 +0200 +++ b/RelaxNG/publidoc.rnc mar. sept. 27 23:30:00 2011 +0200 @@ -434,7 +434,7 @@ media.content = block.head?, - image+, + (image | sound)+, caption?, link? @@ -448,6 +448,12 @@ image.content = copyright? +# ~~~~~~ sound +sound = element sound { sound.attributes } + +sound.attributes = + media.id.attribute + # ============================================================================= # INLINE LEVEL @@ -590,22 +596,15 @@ link.attributes = (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 = element anchor { anchor.attributes } anchor.attributes = anchor.id.attribute anchor.id.attribute = attribute xml:id { xsd:ID } - -anchor.content = inlines diff -r 32381a87f807 -r 5be33d03941a RelaxNG/publidoc.rng --- a/RelaxNG/publidoc.rng mar. sept. 27 17:12:04 2011 +0200 +++ b/RelaxNG/publidoc.rng mar. sept. 27 23:30:00 2011 +0200 @@ -935,7 +935,10 @@ <ref name="block.head"/> </optional> <oneOrMore> - <ref name="image"/> + <choice> + <ref name="image"/> + <ref name="sound"/> + </choice> </oneOrMore> <optional> <ref name="caption"/> @@ -964,6 +967,15 @@ <ref name="copyright"/> </optional> </define> + <!-- ~~~~~~ sound --> + <define name="sound"> + <element name="sound"> + <ref name="sound.attributes"/> + </element> + </define> + <define name="sound.attributes"> + <ref name="media.id.attribute"/> + </define> <!-- ============================================================================= INLINE LEVEL @@ -1285,15 +1297,10 @@ </element> </define> <define name="link.attributes"> - <interleave> - <choice> - <ref name="uri.attribute"/> - <ref name="idref.attribute"/> - </choice> - <optional> - <ref name="anchor.attribute"/> - </optional> - </interleave> + <choice> + <ref name="uri.attribute"/> + <ref name="idref.attribute"/> + </choice> </define> <define name="uri.attribute"> <attribute name="uri"> @@ -1305,26 +1312,13 @@ <data type="IDREF"/> </attribute> </define> - <define name="anchor.attribute"> - <attribute name="anchor"> - <data type="NCName"/> - </attribute> - </define> <define name="link.content"> <ref name="inlines"/> </define> <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ anchor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> <define name="anchor"> <element name="anchor"> - <choice> - <group> - <ref name="anchor.attributes"/> - <ref name="anchor.content"/> - </group> - <attribute name="startref"> - <data type="IDREF"/> - </attribute> - </choice> + <ref name="anchor.attributes"/> </element> </define> <define name="anchor.attributes"> @@ -1335,7 +1329,4 @@ <data type="ID"/> </attribute> </define> - <define name="anchor.content"> - <ref name="inlines"/> - </define> </grammar> diff -r 32381a87f807 -r 5be33d03941a Xml/Documents/Sounds/6channels.wav Binary file Xml/Documents/Sounds/6channels.wav has changed diff -r 32381a87f807 -r 5be33d03941a Xml/Documents/torture_test.xml --- a/Xml/Documents/torture_test.xml mar. sept. 27 17:12:04 2011 +0200 +++ b/Xml/Documents/torture_test.xml mar. sept. 27 23:30:00 2011 +0200 @@ -264,11 +264,13 @@ <section> <media> <image id="prismallia_logo"/> - <caption> - <p>Le logo de <name>Prismallia</name></p> - </caption> + <caption>Le logo de <name>Prismallia</name></caption> <link uri="http://www.prismallia.fr"/> </media> + <media> + <sound id="6channels"/> + <caption>Son 5.1</caption> + </media> </section> </topic> </division> @@ -284,16 +286,11 @@ <item> <label>Ancres</label> <p> - Une <anchor xml:id="a001">ancre</anchor> est un objet embarqué, - lourd, souvent de métal et destiné à stabiliser des bateaux à - un endroit spécifique sur les fonds rocheux, vaseux ou - sableux. <anchor xml:id="a002"/>Il y a deux catégories - d’ancrages (ou mouillage), les ancrages provisoires et les - ancrages permanents. - </p> - <p> - Un ancrage fonctionne en s’opposant à la force exercée par le - navire qui y est relié.<anchor startref="a002"/> + Une <anchor xml:id="a001"/>ancre est un objet embarqué, lourd, + souvent de métal et destiné à stabiliser des bateaux à un + endroit spécifique sur les fonds rocheux, vaseux ou sableux. Il + y a deux catégories d’ancrages (ou mouillage), les ancrages + provisoires et les ancrages permanents. </p> </item> <item> @@ -411,8 +408,7 @@ </p> <p> Lisez également l'article sur les <link - idref="a01">ancres</link> ou un <link - idref="a02">extrait</link>. + idref="a001">ancres</link>. </p> </item> </list>