]> granicus.if.org Git - docbook-dsssl/commitdiff
Reorganize code for consistency with FO; check for obviously broken tables
authorNorman Walsh <ndw@nwalsh.com>
Wed, 27 Aug 2003 23:58:14 +0000 (23:58 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 27 Aug 2003 23:58:14 +0000 (23:58 +0000)
xsl/html/docbook.xsl
xsl/html/formal.xsl
xsl/html/htmltbl.xsl [new file with mode: 0644]
xsl/html/table.xsl

index 80106977b0a032cf56eb0498a7fb5baba3000b07..044b68e8e3a426ab3b88880633d2b8879c0ede88 100644 (file)
@@ -40,6 +40,7 @@
 <xsl:include href="xref.xsl"/>
 <xsl:include href="formal.xsl"/>
 <xsl:include href="table.xsl"/>
+<xsl:include href="htmltbl.xsl"/>
 <xsl:include href="sections.xsl"/>
 <xsl:include href="inline.xsl"/>
 <xsl:include href="footnote.xsl"/>
index 686c55cffc0e176b2b1f93e9dafaeca2e4d6d1dc..8245f4c8e93209ac9d2c3f4a20caecdedde16b29 100644 (file)
 </xsl:template>
 
 <xsl:template name="calsTable">
+  <xsl:if test="tgroup/tbody/tr
+                |tgroup/thead/tr
+                |tgroup/tfoot/tr">
+    <xsl:message terminate="yes">Broken table: tr descendent of CALS Table.</xsl:message>
+  </xsl:if>
+
   <xsl:variable name="param.placement"
                 select="substring-after(normalize-space($formal.title.placement),
                                         concat(local-name(.), ' '))"/>
 </xsl:template>
 
 <xsl:template name="htmlTable">
+  <xsl:if test="tgroup/tbody/row
+                |tgroup/thead/row
+                |tgroup/tfoot/row">
+    <xsl:message terminate="yes">Broken table: row descendent of HTML table.</xsl:message>
+  </xsl:if>
+
   <xsl:apply-templates mode="htmlTable"/>
 </xsl:template>
 
diff --git a/xsl/html/htmltbl.xsl b/xsl/html/htmltbl.xsl
new file mode 100644 (file)
index 0000000..d1f3ceb
--- /dev/null
@@ -0,0 +1,43 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                version="1.0">
+
+<xsl:template match="colgroup" mode="htmlTable">
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates mode="htmlTable"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="col" mode="htmlTable">
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="caption" mode="htmlTable">
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+
+    <xsl:apply-templates select=".." mode="object.title.markup">
+      <xsl:with-param name="allow-anchors" select="1"/>
+    </xsl:apply-templates>
+
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="thead|tbody|tgroup|tr" mode="htmlTable">
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates mode="htmlTable"/>
+  </xsl:copy>
+</xsl:template>
+
+<xsl:template match="th|td" mode="htmlTable">
+  <xsl:copy>
+    <xsl:copy-of select="@*"/>
+    <xsl:apply-templates/> <!-- *not* mode=htmlTable -->
+  </xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>
index 2f649c51d3ad00378b73f4dde6fb734ca70ebf85..2ec97b60cb26415be87216a1d6c7f101d429d7da 100644 (file)
   -->
 </xsl:template>
 
-<!-- ====================================================================== -->
-<!-- HTML Tables -->
-
-<xsl:template match="colgroup" mode="htmlTable">
-  <xsl:copy>
-    <xsl:copy-of select="@*"/>
-    <xsl:apply-templates mode="htmlTable"/>
-  </xsl:copy>
-</xsl:template>
-
-<xsl:template match="col" mode="htmlTable">
-  <xsl:copy>
-    <xsl:copy-of select="@*"/>
-  </xsl:copy>
-</xsl:template>
-
-<xsl:template match="caption" mode="htmlTable">
-  <xsl:copy>
-    <xsl:copy-of select="@*"/>
-
-    <xsl:apply-templates select=".." mode="object.title.markup">
-      <xsl:with-param name="allow-anchors" select="1"/>
-    </xsl:apply-templates>
-
-  </xsl:copy>
-</xsl:template>
-
-<xsl:template match="thead|tbody|tgroup|tr" mode="htmlTable">
-  <xsl:copy>
-    <xsl:copy-of select="@*"/>
-    <xsl:apply-templates mode="htmlTable"/>
-  </xsl:copy>
-</xsl:template>
-
-<xsl:template match="th|td" mode="htmlTable">
-  <xsl:copy>
-    <xsl:copy-of select="@*"/>
-    <xsl:apply-templates/> <!-- *not* mode=htmlTable -->
-  </xsl:copy>
-</xsl:template>
-
 </xsl:stylesheet>