Nouvelles tables
authorPatrick PIERRE <patrick.pierre@prismallia.fr>
sam., 21 sept. 2013 11:44:27 +0200
changeset 249 88251c3ce4a9
parent 248 b62d4097845e
child 250 9f81d8e6405d
Nouvelles tables
RelaxNG/Examples/Documents/torture_test.xml
RelaxNG/publiquiz.rnc
--- a/RelaxNG/Examples/Documents/torture_test.xml	sam. sept. 21 11:32:02 2013 +0200
+++ b/RelaxNG/Examples/Documents/torture_test.xml	sam. sept. 21 11:44:27 2013 +0200
@@ -506,16 +506,93 @@
             <title>Les tableaux</title>
           </head>
           <section>
+            <head>
+              <title>Tableau standard</title>
+            </head>
+
+            <table>
+              <head><title>Consonnes sonores et sourdes en russe</title></head>
+              <tr><th>Consonnes sonores</th><th>Consonnes sourdes</th></tr>
+              <tr><td>г, б, з, д, в, ж</td><td>к, п, с, т, ф, ш</td></tr>
+            </table>
+            
+            <table type="template">
+              <head><title>Journal de navigation</title></head>
+              <thead>
+                <tr>
+                  <td rowspan="2"> </td>
+                  <td colspan="4" rowspan="2">
+                    <p>Avion :</p><p>Horamètre :</p>
+                  </td>
+                </tr>
+                <tr>
+                  <td colspan="4">
+                    <p>Autonomie :</p><p>Heure :</p>
+                  </td>
+                </tr>
+                <tr>
+                  <th> </th>
+                  <th>Rm</th>
+                  <th>D (NM)</th>
+                  <th colspan="2">He, Hr/Tsv (min)</th>
+                  <th>Radio</th>
+                  <th>VOR</th>
+                  <th>Alt. (ft)</th>
+                  <th>Zone…</th>
+                </tr>
+              </thead>
+              <tbody>
+                <tr>
+                  <td colspan="3">Chavenay</td><td> </td><td> </td>
+                  <td align="left">Tour : 129,525</td>
+                  <td> </td><td> </td><td> </td>
+                </tr>
+                <tr align="center">
+                  <td> </td><td>220°</td><td>8</td><td colspan="2">+5</td>
+                  <td> </td><td> </td><td>max : 2000</td><td> </td>
+                </tr>
+                <tr>
+                  <td colspan="3">Étangs de Hollande</td><td> </td><td> </td>
+                  <td> </td><td> </td><td> </td><td> </td>
+                </tr>
+                <tr align="center">
+                  <td> </td><td>155°</td><td>23</td><td colspan="2">+14</td>
+                  <td> </td><td> </td><td>max : 2500</td><td> </td>
+                </tr>
+                <tr>
+                  <td colspan="3">Étampes</td><td> </td><td> </td>
+                  <td align="left"><p>Tour : 119,05</p></td>
+                  <td> </td><td> </td><td> </td>
+                </tr>
+                <tr>
+                  <td colspan="5">
+                    <p><highlight>ATIS</highlight></p>
+                    <p>QNH</p><p>QFU</p><p>Visi.</p><p>Vent</p>
+                  </td>
+                  <td colspan="4" align="right">
+                    <p><highlight>ATIS</highlight></p>
+                    <p>QNH</p><p>QFU</p><p>Visi.</p><p>Vent</p>
+                  </td>
+                </tr>
+              </tbody>
+              <caption>Archive P²</caption>
+            </table>
+          </section>
+          
+          <section>
+            <head>
+              <title>Tableau CALS</title>
+            </head>
             <table>
               <head>
                 <title>Grades de la Marine nationale</title>
               </head>
-              <tgroup cols="3" align="left">
+              <tgroup cols="3">
                 <thead>
                   <row>
-                    <entry align="center">Grade d'officier supérieur</entry>
+                    <entry align="left">Grade d'officier supérieur</entry>
                     <entry align="center">Appellation</entry>
-                    <entry align="center">Surnom</entry>
+                    <entry align="right">Surnom</entry>
                   </row>
                 </thead>
                 <tbody>
@@ -539,9 +616,9 @@
               <tgroup cols="3">
                 <thead>
                   <row>
-                    <entry>Grade d'officier subalterne</entry>
-                    <entry>Appellation</entry>
-                    <entry>Surnom</entry>
+                    <entry align="left">Grade d'officier subalterne</entry>
+                    <entry align="center">Appellation</entry>
+                    <entry align="right">Surnom</entry>
                   </row>
                 </thead>
                 <tbody>
@@ -570,9 +647,9 @@
               <tgroup cols="3">
                 <thead>
                   <row>
-                    <entry>Grade d'officier marinier</entry>
-                    <entry>Appellation</entry>
-                    <entry>Surnom</entry>
+                    <entry align="left">Grade d'officier marinier</entry>
+                    <entry align="center">Appellation</entry>
+                    <entry align="right">Surnom</entry>
                   </row>
                 </thead>
                 <tbody>
--- a/RelaxNG/publiquiz.rnc	sam. sept. 21 11:32:02 2013 +0200
+++ b/RelaxNG/publiquiz.rnc	sam. sept. 21 11:44:27 2013 +0200
@@ -316,63 +316,55 @@
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-blanks.table = element table { blanks.table.content }
-point.table = element table { point.table.content }
+blanks.table = element table { table.attributes, blanks.table.content }
+point.table = element table { table.attributes, point.table.content }
 
 blanks.table.content =
    block.head?,
-   blanks.tgroup+,
+   thead?,
+   (blanks.tbody+ | blanks.tr+),
    table.caption?
 point.table.content =
    block.head?,
-   point.tgroup+,
+   (point.tbody+ | point.tr+),
    table.caption?
 
-# ~~~~~~ tgroup
-blanks.tgroup = element tgroup { tgroup.attributes, blanks.tgroup.content }
-point.tgroup = element tgroup { tgroup.attributes, point.tgroup.content }
-
-blanks.tgroup.content =
-   thead?,
-   blanks.tbody
-point.tgroup.content =
-   thead?,
-   point.tbody
-
 # ~~~~~~ tbody
-blanks.tbody = element tbody { tbody.attributes, blanks.tbody.content }
-point.tbody = element tbody { tbody.attributes, point.tbody.content }
+blanks.tbody = element tbody { blanks.tbody.content }
+point.tbody = element tbody { point.tbody.content }
 
 blanks.tbody.content =
-   blanks.row+
+   blanks.tr+
 point.tbody.content =
-   point.row+
+   point.tr+
 
-# ~~~~~~ row
-blanks.row = element row { row.attributes, blanks.row.content }
-point.row = element row { row.attributes, point.row.content }
+# ~~~~~~ tr
+blanks.tr = element tr { tr.attributes, blanks.tr.content }
+point.tr = element tr { tr.attributes, point.tr.content }
 
-blanks.row.content =
-  blanks.entry+
-point.row.content =
-  point.entry+
+blanks.tr.content =
+  (blanks.td | blanks.th)+
+point.tr.content =
+  (point.td | point.th)+
 
-# ~~~~~~ entry
-blanks.entry = element entry { blanks.entry.content }
-point.entry = element entry { point.entry.content }
+# ~~~~~~ td, th
+blanks.td = element td { td.attributes, blanks.td.content }
+blanks.th = element th { td.attributes, blanks.td.content }
+point.td = element td { td.attributes, point.td.content }
+point.th = element th { td.attributes, point.td.content }
 
-blanks.entry.content =
+blanks.td.content =
    blanks.inlines
  | (p | media)+
 
-point.entry.content =
+point.td.content =
    point.inlines
  | (p | media)+
 
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 # ~~~~~~ blanks.media
-blanks.media = element media { blanksmedia.content }
+blanks.media = element media { media.attributes, blanksmedia.content }
 
 blanksmedia.content =
    block.head?,