Ajout de l'attribut 'type' aux images
authorPatrick PIERRE <patrick.pierre@prismallia.fr>
dim., 23 oct. 2011 16:45:12 +0200
changeset 49 e533ca9494a6
parent 48 136c5977c215
child 50 5181169ff02d
Ajout de l'attribut 'type' aux images
RelaxNG/publidoc.rnc
RelaxNG/publidoc.rng
Xml/Documents/Images/cosette.jpg
Xml/Documents/torture_test.xml
--- a/RelaxNG/publidoc.rnc	ven. oct. 07 16:19:44 2011 +0200
+++ b/RelaxNG/publidoc.rnc	dim. oct. 23 16:45:12 2011 +0200
@@ -454,8 +454,10 @@
 image = element image { image.attributes, image.content }
 
 image.attributes =
-   media.id.attribute
+   media.id.attribute,
+   image.type?
 media.id.attribute = attribute id { xsd:NMTOKEN }
+image.type = attribute type { "thumbnail" }
 
 image.content =
    copyright?
--- a/RelaxNG/publidoc.rng	ven. oct. 07 16:19:44 2011 +0200
+++ b/RelaxNG/publidoc.rng	dim. oct. 23 16:45:12 2011 +0200
@@ -975,12 +975,20 @@
   </define>
   <define name="image.attributes">
     <ref name="media.id.attribute"/>
+    <optional>
+      <ref name="image.type"/>
+    </optional>
   </define>
   <define name="media.id.attribute">
     <attribute name="id">
       <data type="NMTOKEN"/>
     </attribute>
   </define>
+  <define name="image.type">
+    <attribute name="type">
+      <value>thumbnail</value>
+    </attribute>
+  </define>
   <define name="image.content">
     <optional>
       <ref name="copyright"/>
Binary file Xml/Documents/Images/cosette.jpg has changed
--- a/Xml/Documents/torture_test.xml	ven. oct. 07 16:19:44 2011 +0200
+++ b/Xml/Documents/torture_test.xml	dim. oct. 23 16:45:12 2011 +0200
@@ -279,7 +279,15 @@
         </head>
         <section>
           <media>
-            <image id="prismallia_logo"/>
+            <image id="cosette"/>
+            <caption>
+              <name of="person">Cosette</name>, illustration pour Les <name
+              of="book">Misérables</name> par <name of="person">Émile
+              Bayard</name>.
+            </caption>
+          </media>
+          <media>
+            <image id="prismallia_logo" type="thumbnail"/>
             <caption>Le logo de <name>Prismallia</name></caption>
             <link uri="http://www.prismallia.fr"/>
           </media>