Ajout de la gestion des couvertures
authorPatrick PIERRE <patrick.pierre@prismallia.fr>
mar., 19 juil. 2011 11:01:54 +0200
changeset 35 de4114d12ef1
parent 34 c51d5097d065
child 36 d23cfb7be79e
Ajout de la gestion des couvertures
RelaxNG/publidoc.rnc
RelaxNG/publidoc.rng
RelaxNG/publiset.rnc
RelaxNG/publiset.rng
Xml/Documents/Images/torture_test.jpg
Xml/Documents/torture_test.xml
Xml/Sets/Images/composition.xcf
Xml/Sets/composition.xml
--- a/RelaxNG/publidoc.rnc	lun. juil. 18 23:35:32 2011 +0200
+++ b/RelaxNG/publidoc.rnc	mar. juil. 19 11:01:54 2011 +0200
@@ -70,6 +70,7 @@
  & source*
  & subjectset?
  & abstract?
+ & cover?
  & annotation*
 division.head.content =
    (title, subtitle?)?
@@ -214,6 +215,19 @@
 abstract.content =
    p+
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+cover = element cover { cover.content }
+
+cover.content =
+   cover.image
+
+cover.image = element image { cover.image.attributes }
+
+cover.image.attributes =
+   cover.image.id.attribute
+cover.image.id.attribute = attribute id { xsd:NMTOKEN }
+
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 annotation = element annotation { annotation.content }
@@ -397,7 +411,7 @@
    inlines
  | p+
 
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 # ~~~~~~ media
 media = element media { media.content }
@@ -405,7 +419,8 @@
 media.content =
    block.head?,
    image+,
-   caption?
+   caption?,
+   url?
 
 # ~~~~~~ image
 image = element image { image.attributes, image.content }
--- a/RelaxNG/publidoc.rng	lun. juil. 18 23:35:32 2011 +0200
+++ b/RelaxNG/publidoc.rng	mar. juil. 19 11:01:54 2011 +0200
@@ -156,6 +156,9 @@
       <optional>
         <ref name="abstract"/>
       </optional>
+      <optional>
+        <ref name="cover"/>
+      </optional>
       <zeroOrMore>
         <ref name="annotation"/>
       </zeroOrMore>
@@ -464,6 +467,28 @@
       <ref name="p"/>
     </oneOrMore>
   </define>
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <define name="cover">
+    <element name="cover">
+      <ref name="cover.content"/>
+    </element>
+  </define>
+  <define name="cover.content">
+    <ref name="cover.image"/>
+  </define>
+  <define name="cover.image">
+    <element name="image">
+      <ref name="cover.image.attributes"/>
+    </element>
+  </define>
+  <define name="cover.image.attributes">
+    <ref name="cover.image.id.attribute"/>
+  </define>
+  <define name="cover.image.id.attribute">
+    <attribute name="id">
+      <data type="NMTOKEN"/>
+    </attribute>
+  </define>
   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ annotation ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   <define name="annotation">
     <element name="annotation">
@@ -862,7 +887,7 @@
       </oneOrMore>
     </choice>
   </define>
-  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   <!-- ~~~~~~ media -->
   <define name="media">
     <element name="media">
@@ -879,6 +904,9 @@
     <optional>
       <ref name="caption"/>
     </optional>
+    <optional>
+      <ref name="url"/>
+    </optional>
   </define>
   <!-- ~~~~~~ image -->
   <define name="image">
--- a/RelaxNG/publiset.rnc	lun. juil. 18 23:35:32 2011 +0200
+++ b/RelaxNG/publiset.rnc	mar. juil. 19 11:01:54 2011 +0200
@@ -79,6 +79,7 @@
  & author*
  & publisher?
  & source?
+ & cover?
 division.head.content =
    (title, subtitle?)?
  & language?
@@ -181,6 +182,19 @@
 pagenumber.value.attribute = attribute value { pagenumber.value.enumeration }
 pagenumber.value.enumeration = xsd:positiveInteger
 
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+cover = element cover { cover.content }
+
+cover.content =
+   cover.image
+
+cover.image = element image { cover.image.attributes }
+
+cover.image.attributes =
+   cover.image.id.attribute
+cover.image.id.attribute = attribute id { xsd:NMTOKEN }
+
 
 # =============================================================================
 #                                DIVISION LEVEL
--- a/RelaxNG/publiset.rng	lun. juil. 18 23:35:32 2011 +0200
+++ b/RelaxNG/publiset.rng	mar. juil. 19 11:01:54 2011 +0200
@@ -162,6 +162,9 @@
       <optional>
         <ref name="source"/>
       </optional>
+      <optional>
+        <ref name="cover"/>
+      </optional>
     </interleave>
   </define>
   <define name="division.head.content">
@@ -379,6 +382,28 @@
   <define name="pagenumber.value.enumeration">
     <data type="positiveInteger"/>
   </define>
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cover ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <define name="cover">
+    <element name="cover">
+      <ref name="cover.content"/>
+    </element>
+  </define>
+  <define name="cover.content">
+    <ref name="cover.image"/>
+  </define>
+  <define name="cover.image">
+    <element name="image">
+      <ref name="cover.image.attributes"/>
+    </element>
+  </define>
+  <define name="cover.image.attributes">
+    <ref name="cover.image.id.attribute"/>
+  </define>
+  <define name="cover.image.id.attribute">
+    <attribute name="id">
+      <data type="NMTOKEN"/>
+    </attribute>
+  </define>
   <!--
     =============================================================================
                                    DIVISION LEVEL
Binary file Xml/Documents/Images/torture_test.jpg has changed
--- a/Xml/Documents/torture_test.xml	lun. juil. 18 23:35:32 2011 +0200
+++ b/Xml/Documents/torture_test.xml	mar. juil. 19 11:01:54 2011 +0200
@@ -26,17 +26,18 @@
         <pagenumber value="312"/>
       </source>
       <source type="file" id="hugo_miserables.xml"/>
+      <subjectset>
+        <subject id="test"/>
+        <subject id="littérature"/>
+      </subjectset>
       <abstract>
         <p>
           Ce fichier rassemble un maximum de situations afin de tester les
           possibilités de <name>publidoc</name>.
         </p>
       </abstract>
-      <subjectset>
-        <subject id="test"/>
-        <subject id="littérature"/>
-      </subjectset>
-      <annotation></annotation>
+      <cover><image id="torture_test"/></cover>
+      <annotation>Ce fichier n'a pas de réelle signification</annotation>
     </head>
 
     <!-- ================================================================== -->
Binary file Xml/Sets/Images/composition.xcf has changed
--- a/Xml/Sets/composition.xml	lun. juil. 18 23:35:32 2011 +0200
+++ b/Xml/Sets/composition.xml	mar. juil. 19 11:01:54 2011 +0200
@@ -14,6 +14,7 @@
           <label>Prismallia</label>
           <url>http://www.prismallia.fr</url>
         </publisher>
+        <cover><image id="composition"/></cover>
       </head>
 
       <!-- ========================== Événements ========================== -->