RelaxNG/publidoc.rng
changeset 17 ca367d4d080b
parent 12 2885b2c3ff59
child 20 79713ffae179
--- a/RelaxNG/publidoc.rng	sam. juin 11 18:01:26 2011 +0200
+++ b/RelaxNG/publidoc.rng	sam. juin 11 20:35:18 2011 +0200
@@ -400,11 +400,12 @@
                                     Block level
     =============================================================================
   -->
-  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ blocks ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   <define name="block">
     <choice>
       <ref name="parag"/>
       <ref name="list"/>
+      <ref name="table"/>
       <ref name="speech"/>
       <ref name="media"/>
     </choice>
@@ -423,7 +424,7 @@
       </zeroOrMore>
     </interleave>
   </define>
-  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ list ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   <!-- ~~~~~~ list -->
   <define name="list">
     <element name="list">
@@ -488,6 +489,166 @@
   <define name="label.content">
     <ref name="inlines"/>
   </define>
+  <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
+  <define name="table">
+    <element name="table">
+      <ref name="table.content"/>
+    </element>
+  </define>
+  <define name="table.content">
+    <optional>
+      <ref name="title"/>
+    </optional>
+    <oneOrMore>
+      <ref name="tgroup"/>
+    </oneOrMore>
+    <optional>
+      <ref name="caption"/>
+    </optional>
+  </define>
+  <!-- ~~~~~~ tgroup -->
+  <define name="tgroup">
+    <element name="tgroup">
+      <ref name="tgroup.attributes"/>
+      <ref name="tgroup.content"/>
+    </element>
+  </define>
+  <define name="tgroup.content">
+    <optional>
+      <ref name="thead"/>
+    </optional>
+    <optional>
+      <ref name="tfoot"/>
+    </optional>
+    <ref name="tbody"/>
+  </define>
+  <define name="tgroup.attributes">
+    <interleave>
+      <ref name="cols.attribute"/>
+      <optional>
+        <ref name="align.attribute"/>
+      </optional>
+      <optional>
+        <ref name="colsep.attribute"/>
+      </optional>
+      <optional>
+        <ref name="rowsep.attribute"/>
+      </optional>
+    </interleave>
+  </define>
+  <define name="cols.attribute">
+    <attribute name="cols">
+      <data type="positiveInteger"/>
+    </attribute>
+  </define>
+  <define name="align.attribute">
+    <attribute name="align">
+      <choice>
+        <value>left</value>
+        <value>right</value>
+        <value>center</value>
+        <value>justify</value>
+      </choice>
+    </attribute>
+  </define>
+  <define name="colsep.attribute">
+    <attribute name="colsep">
+      <choice>
+        <value>0</value>
+        <value>1</value>
+      </choice>
+    </attribute>
+  </define>
+  <define name="rowsep.attribute">
+    <attribute name="rowsep">
+      <choice>
+        <value>0</value>
+        <value>1</value>
+      </choice>
+    </attribute>
+  </define>
+  <!-- ~~~~~~ thead, tfoot, tbody -->
+  <define name="thead">
+    <element name="thead">
+      <ref name="thead.content"/>
+    </element>
+  </define>
+  <define name="tfoot">
+    <element name="tfoot">
+      <ref name="tfoot.content"/>
+    </element>
+  </define>
+  <define name="tbody">
+    <element name="tbody">
+      <ref name="tbody.content"/>
+    </element>
+  </define>
+  <define name="thead.content">
+    <oneOrMore>
+      <ref name="row"/>
+    </oneOrMore>
+  </define>
+  <define name="tfoot.content">
+    <oneOrMore>
+      <ref name="row"/>
+    </oneOrMore>
+  </define>
+  <define name="tbody.content">
+    <oneOrMore>
+      <ref name="row"/>
+    </oneOrMore>
+  </define>
+  <!-- ~~~~~~ row -->
+  <define name="row">
+    <element name="row">
+      <ref name="row.attribute"/>
+      <ref name="row.content"/>
+    </element>
+  </define>
+  <define name="row.attribute">
+    <optional>
+      <ref name="valign.attribute"/>
+    </optional>
+  </define>
+  <define name="valign.attribute">
+    <attribute name="valign">
+      <choice>
+        <value>top</value>
+        <value>middle</value>
+        <value>bottom</value>
+      </choice>
+    </attribute>
+  </define>
+  <define name="row.content">
+    <oneOrMore>
+      <ref name="entry"/>
+    </oneOrMore>
+  </define>
+  <!-- ~~~~~~ entry -->
+  <define name="entry">
+    <element name="entry">
+      <ref name="entry.content"/>
+    </element>
+  </define>
+  <define name="entry.content">
+    <choice>
+      <ref name="inlines"/>
+      <oneOrMore>
+        <ref name="parag"/>
+      </oneOrMore>
+    </choice>
+  </define>
+  <!-- ~~~~~~ caption -->
+  <define name="caption">
+    <element name="caption">
+      <ref name="caption.content"/>
+    </element>
+  </define>
+  <define name="caption.content">
+    <oneOrMore>
+      <ref name="parag"/>
+    </oneOrMore>
+  </define>
   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ speech ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   <!-- ~~~~~~ speech -->
   <define name="speech">
@@ -536,14 +697,9 @@
       <ref name="image"/>
     </oneOrMore>
     <optional>
-      <ref name="media.caption"/>
+      <ref name="caption"/>
     </optional>
   </define>
-  <define name="media.id.attribute">
-    <attribute name="id">
-      <data type="NMTOKEN"/>
-    </attribute>
-  </define>
   <!-- ~~~~~~ image -->
   <define name="image">
     <element name="image">
@@ -554,22 +710,16 @@
   <define name="image.attributes">
     <ref name="media.id.attribute"/>
   </define>
+  <define name="media.id.attribute">
+    <attribute name="id">
+      <data type="NMTOKEN"/>
+    </attribute>
+  </define>
   <define name="image.content">
     <optional>
       <ref name="copyright"/>
     </optional>
   </define>
-  <!-- ~~~~~~ caption -->
-  <define name="media.caption">
-    <element name="caption">
-      <ref name="media.caption.content"/>
-    </element>
-  </define>
-  <define name="media.caption.content">
-    <oneOrMore>
-      <ref name="parag"/>
-    </oneOrMore>
-  </define>
   <!-- ~~~~~~ copyright -->
   <define name="copyright">
     <element name="copyright">
@@ -768,9 +918,12 @@
     <attribute name="label"/>
   </define>
   <define name="note.content">
-    <oneOrMore>
-      <ref name="parag"/>
-    </oneOrMore>
+    <choice>
+      <ref name="inlines"/>
+      <oneOrMore>
+        <ref name="parag"/>
+      </oneOrMore>
+    </choice>
   </define>
   <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ foreign ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
   <define name="foreign">