--- a/RelaxNG/publidoc.rnc jeu. sept. 05 10:41:01 2013 +0200
+++ b/RelaxNG/publidoc.rnc sam. sept. 21 11:32:02 2013 +0200
@@ -204,7 +204,7 @@
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ block ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~ block
-block = (p | speech | \list | blockquote | table | media)
+block = (p | speech | \list | blockquote | table | table.cals | media)
# ~~~~~~ block.head
block.head = element head { block.head.content }
@@ -274,68 +274,55 @@
sup* & number* & date* & name* & foreign* & acronym* & term* & literal*
& highlight* & emphasis* & mentioned* & note* & warning* }
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~ table
-table = element table { table.content }
+table = element table { table.attributes, table.content }
+
+table.attributes =
+ table.type.attribute?
+table.type.attribute = attribute type { xsd:NCName }
table.content =
block.head?,
- tgroup+,
+ thead?,
+ (tbody+ | tr+),
table.caption?
-# ~~~~~~ tgroup
-tgroup = element tgroup { tgroup.attributes, tgroup.content }
+# ~~~~~~ thead, tbody
+thead = element thead { thead.content }
+tbody = element tbody { tbody.content }
-tgroup.content =
- thead?,
- tbody
+thead.content =
+ tr+
+tbody.content =
+ tr+
-tgroup.attributes =
- cols.attribute
- & align.attribute?
- & colsep.attribute?
- & rowsep.attribute?
-cols.attribute = attribute cols { xsd:positiveInteger }
+# ~~~~~~ tr
+tr = element tr { tr.attributes, tr.content }
+
+tr.attributes =
+ align.attribute?
+ & valign.attribute?
align.attribute = attribute align { "left" | "right" | "center" | "justify" }
-colsep.attribute = attribute colsep { "0" | "1" }
-rowsep.attribute = attribute rowsep { "0" | "1" }
-
-# ~~~~~~ thead, tbody
-thead = element thead { thead.attributes, thead.content }
-tbody = element tbody { tbody.attributes, tbody.content }
-
-thead.attributes =
- valign.attribute?
-tbody.attributes =
- valign.attribute?
valign.attribute = attribute valign { "top" | "middle" | "bottom" }
-thead.content =
- row+
-tbody.content =
- row+
+tr.content =
+ (td | th)+
-# ~~~~~~ row
-row = element row { row.attributes, row.content }
+# ~~~~~~ td, th
+td = element td { td.attributes, td.content }
+th = element th { td.attributes, td.content }
-row.attributes =
- valign.attribute?
- & rowsep.attribute?
-
-row.content =
- table.entry+
-
-# ~~~~~~ table.entry
-table.entry = element entry { table.entry.attributes, table.entry.content }
-
-table.entry.attributes =
+td.attributes =
align.attribute?
& valign.attribute?
- & colsep.attribute?
- & rowsep.attribute?
+ & colspan.attribute?
+ & rowspan.attribute?
+colspan.attribute = attribute colspan { xsd:positiveInteger }
+rowspan.attribute = attribute rowspan { xsd:positiveInteger }
-table.entry.content =
+td.content =
inlines
| (p | media)+
@@ -346,6 +333,57 @@
inlines
| (p | speech | \list | blockquote)+
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ table.cals ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# ~~~~~~ table.cals
+table.cals = element table { table.attributes, table.cals.content }
+
+table.cals.content =
+ block.head?,
+ tgroup+,
+ table.caption?
+
+# ~~~~~~ tgroup
+tgroup = element tgroup { tgroup.attributes, tgroup.content }
+
+tgroup.attributes =
+ cols.attribute
+cols.attribute = attribute cols { xsd:positiveInteger }
+
+tgroup.content =
+ thead.cals?,
+ tbody.cals
+
+# ~~~~~~ thead, tbody
+thead.cals = element thead { thead.cals.content }
+tbody.cals = element tbody { tbody.cals.content }
+
+thead.cals.content =
+ row+
+tbody.cals.content =
+ row+
+
+# ~~~~~~ row
+row = element row { row.attributes, row.content }
+
+row.attributes =
+ valign.attribute?
+
+row.content =
+ table.cals.entry+
+
+# ~~~~~~ table.cals.entry
+table.cals.entry = element entry {
+ table.cals.entry.attributes, table.cals.entry.content }
+
+table.cals.entry.attributes =
+ align.attribute?
+ & valign.attribute?
+
+table.cals.entry.content =
+ inlines
+ | (p | media)+
+
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ media ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# ~~~~~~ media