trang
authorPatrick PIERRE <patrick.pierre@prismallia.fr>
sam., 11 juin 2011 00:33:24 +0200
changeset 10 0c7725713208
parent 9 1efd69b7c90e
child 11 2b32b535705c
trang
RelaxNG/publidoc.rng
--- a/RelaxNG/publidoc.rng	sam. juin 11 00:27:50 2011 +0200
+++ b/RelaxNG/publidoc.rng	sam. juin 11 00:33:24 2011 +0200
@@ -381,11 +381,7 @@
         <ref name="section"/>
       </oneOrMore>
       <oneOrMore>
-        <choice>
-          <ref name="parag"/>
-          <ref name="media"/>
-          <ref name="speech"/>
-        </choice>
+        <ref name="block"/>
       </oneOrMore>
     </choice>
   </define>
@@ -404,7 +400,16 @@
                                     Block level
     =============================================================================
   -->
-  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ parag ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blocks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <define name="block">
+    <choice>
+      <ref name="parag"/>
+      <ref name="list"/>
+      <ref name="media"/>
+      <ref name="speech"/>
+    </choice>
+  </define>
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ parag ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   <define name="parag">
     <element name="parag">
       <ref name="parag.content"/>
@@ -418,6 +423,80 @@
       </zeroOrMore>
     </interleave>
   </define>
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <!-- ~~~~~~ list -->
+  <define name="list">
+    <element name="list">
+      <ref name="list.content"/>
+    </element>
+  </define>
+  <define name="list.content">
+    <optional>
+      <ref name="title"/>
+    </optional>
+    <choice>
+      <group>
+        <optional>
+          <attribute name="type">
+            <value>ordered</value>
+          </attribute>
+        </optional>
+        <ref name="item"/>
+        <oneOrMore>
+          <ref name="item"/>
+        </oneOrMore>
+      </group>
+      <group>
+        <attribute name="type">
+          <value>itemized</value>
+        </attribute>
+        <ref name="item"/>
+        <oneOrMore>
+          <ref name="item"/>
+        </oneOrMore>
+      </group>
+      <group>
+        <attribute name="type">
+          <value>glossary</value>
+        </attribute>
+        <oneOrMore>
+          <ref name="glossary.item"/>
+        </oneOrMore>
+      </group>
+    </choice>
+  </define>
+  <!-- ~~~~~~ item -->
+  <define name="item">
+    <element name="item">
+      <ref name="item.content"/>
+    </element>
+  </define>
+  <define name="item.content">
+    <oneOrMore>
+      <ref name="block"/>
+    </oneOrMore>
+  </define>
+  <!-- ~~~~~~ glossary.item -->
+  <define name="glossary.item">
+    <element name="item">
+      <ref name="glossary.item.content"/>
+    </element>
+  </define>
+  <define name="glossary.item.content">
+    <ref name="label"/>
+    <oneOrMore>
+      <ref name="block"/>
+    </oneOrMore>
+  </define>
+  <!-- ~~~~~~ label -->
+  <define name="label">
+    <element name="label">
+      <ref name="label.content"/>
+    </element>
+  </define>
+  <define name="label.content">
+    <ref name="inlines"/>
+  </define>
   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   <!-- ~~~~~~ media -->
   <define name="media">
@@ -543,9 +622,6 @@
           <ref name="highlight"/>
         </zeroOrMore>
         <zeroOrMore>
-          <ref name="term"/>
-        </zeroOrMore>
-        <zeroOrMore>
           <ref name="mentioned"/>
         </zeroOrMore>
         <zeroOrMore>
@@ -554,6 +630,9 @@
         <zeroOrMore>
           <ref name="acronym"/>
         </zeroOrMore>
+        <zeroOrMore>
+          <ref name="term"/>
+        </zeroOrMore>
       </interleave>
     </mixed>
   </define>
@@ -680,15 +759,6 @@
   <define name="highlight.content">
     <ref name="inlines"/>
   </define>
-  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ term ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
-  <define name="term">
-    <element name="term">
-      <ref name="term.content"/>
-    </element>
-  </define>
-  <define name="term.content">
-    <ref name="inlines"/>
-  </define>
   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mentioned ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   <define name="mentioned">
     <element name="mentioned">
@@ -716,6 +786,15 @@
   <define name="acronym.content">
     <ref name="inlines"/>
   </define>
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ term ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <define name="term">
+    <element name="term">
+      <ref name="term.content"/>
+    </element>
+  </define>
+  <define name="term.content">
+    <ref name="inlines"/>
+  </define>
   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ link ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   <define name="link">
     <element name="link">
@@ -724,7 +803,22 @@
     </element>
   </define>
   <define name="link.attributes">
-    <empty/>
+    <optional>
+      <choice>
+        <ref name="uri.attribute"/>
+        <ref name="idref.attribute"/>
+      </choice>
+    </optional>
+  </define>
+  <define name="uri.attribute">
+    <attribute name="uri">
+      <data type="anyURI"/>
+    </attribute>
+  </define>
+  <define name="idref.attribute">
+    <attribute name="idref">
+      <data type="IDREF"/>
+    </attribute>
   </define>
   <define name="link.content">
     <ref name="inlines"/>