Amélioration de la gestion des tableaux
authorPatrick PIERRE <patrick.pierre@prismallia.fr>
sam., 24 nov. 2012 09:21:12 +0100
changeset 146 aba988da5d50
parent 145 d8fab077a6dc
child 147 ef6d2a49afba
Amélioration de la gestion des tableaux
RelaxNG/Examples/Documents/torture_test.xml
RelaxNG/publidoc.rnc
--- a/RelaxNG/Examples/Documents/torture_test.xml	mar. nov. 20 14:50:34 2012 +0100
+++ b/RelaxNG/Examples/Documents/torture_test.xml	sam. nov. 24 09:21:12 2012 +0100
@@ -393,39 +393,92 @@
           <section>
             <table>
               <head>
-                <title>Un tableau simple</title>
+                <title>Grades de la Marine nationale</title>
               </head>
               <tgroup cols="3" align="left">
                 <thead>
                   <row>
-                    <entry>Head 1</entry>
-                    <entry>Head 2</entry>
-                    <entry>Head 3</entry>
+                    <entry align="center">Grade d'officier supérieur</entry>
+                    <entry align="center">Appellation</entry>
+                    <entry align="center">Surnom</entry>
                   </row>
                 </thead>
-                <tfoot>
-                  <row>
-                    <entry>Foot 1</entry>
-                    <entry>Foot 2</entry>
-                    <entry>Foot 3</entry>
-                  </row>
-                </tfoot>
                 <tbody>
                   <row>
-                    <entry>Cell 1.1</entry>
-                    <entry>Cell 1.2</entry>
-                    <entry>Cell 1.3</entry>
+                    <entry>Capitaine de vaisseau</entry>
+                    <entry align="center">Commandant</entry>
+                    <entry align="right">Cap de veau</entry>
                   </row>
                   <row>
-                    <entry>Cell 2.1</entry>
-                    <entry>Cell 2.2</entry>
-                    <entry>Cell 2.3</entry>
+                    <entry>Capitaine de frégate</entry>
+                    <entry align="center">Commandant</entry>
+                    <entry align="right">Frégaton</entry>
+                  </row>
+                  <row>
+                    <entry>Capitaine de corvette</entry>
+                    <entry align="center">Commandant</entry>
+                    <entry align="right">Corvetard</entry>
                   </row>
                 </tbody>
               </tgroup>
-              <caption>
-                <p>Légende du tableau</p>
-              </caption>
+              <tgroup cols="3">
+                <thead>
+                  <row>
+                    <entry>Grade d'officier subalterne</entry>
+                    <entry>Appellation</entry>
+                    <entry>Surnom</entry>
+                  </row>
+                </thead>
+                <tbody>
+                  <row>
+                    <entry>Lieutenant de vaisseau</entry>
+                    <entry align="center">Capitaine</entry>
+                    <entry align="right">Loufiat</entry>
+                  </row>
+                  <row>
+                    <entry>Enseigne de vaisseau première classe</entry>
+                    <entry align="center">Lieutenant</entry>
+                    <entry align="right"> </entry>
+                  </row>
+                  <row>
+                    <entry>Enseigne de vaisseau deuxième classe</entry>
+                    <entry align="center">Lieutenant</entry>
+                    <entry align="right"> </entry>
+                  </row>
+                  <row>
+                    <entry>Aspirant</entry>
+                    <entry align="center">Lieutenant</entry>
+                    <entry align="right">Midship</entry>
+                  </row>
+                </tbody>
+              </tgroup>
+              <tgroup cols="3">
+                <thead>
+                  <row>
+                    <entry>Grade d'officier marinier</entry>
+                    <entry>Appellation</entry>
+                    <entry>Surnom</entry>
+                  </row>
+                </thead>
+                <tbody>
+                  <row>
+                    <entry>Major</entry>
+                    <entry align="center">Major</entry>
+                    <entry align="right"> </entry>
+                  </row>
+                  <row>
+                    <entry>Maître principal</entry>
+                    <entry align="center">Maître principal</entry>
+                    <entry align="right">Cipal</entry>
+                  </row>
+                  <row>
+                    <entry>Premier maître</entry>
+                    <entry align="center">Premier maître</entry>
+                    <entry align="right">Patron ou Pé M</entry>
+                  </row>
+                </tbody>
+              </tgroup>
+              <caption>Extrait de la nomenclature officielle</caption>
             </table>
           </section>
         </topic>
--- a/RelaxNG/publidoc.rnc	mar. nov. 20 14:50:34 2012 +0100
+++ b/RelaxNG/publidoc.rnc	sam. nov. 24 09:21:12 2012 +0100
@@ -269,7 +269,6 @@
 
 tgroup.content =
    thead?,
-   tfoot?,
    tbody
 
 tgroup.attributes =
@@ -282,37 +281,39 @@
 colsep.attribute = attribute colsep { "0" | "1" }
 rowsep.attribute = attribute rowsep { "0" | "1" }
 
-# ~~~~~~ thead, tfoot, tbody
+# ~~~~~~ thead, tbody
 thead = element thead { thead.attributes, thead.content }
-tfoot = element tfoot { tfoot.attributes, tfoot.content }
 tbody = element tbody { tbody.attributes, tbody.content }
 
 thead.attributes =
    valign.attribute?
-tfoot.attributes =
-   valign.attribute?
 tbody.attributes =
    valign.attribute?
 valign.attribute = attribute valign { "top" | "middle" | "bottom" }
 
 thead.content =
    row+
-tfoot.content =
-   row+
 tbody.content =
    row+
 
 # ~~~~~~ row
-row = element row { row.attribute, row.content }
+row = element row { row.attributes, row.content }
 
-row.attribute =
+row.attributes =
    valign.attribute?
+ & rowsep.attribute?
 
 row.content =
   entry+
 
 # ~~~~~~ entry
-entry = element entry { entry.content }
+entry = element entry { entry.attributes, entry.content }
+
+entry.attributes =
+   align.attribute?
+ & valign.attribute?
+ & colsep.attribute?
+ & rowsep.attribute?
 
 entry.content =
    inlines