]> granicus.if.org Git - docbook-dsssl/commitdiff
Handle mediaobject/graphic elements in CALS tables
authorkibook <annadaniau@gmail.com>
Mon, 31 Jul 2017 19:53:05 +0000 (15:53 -0400)
committerbobstayton <bobs@sagehill.net>
Mon, 11 Jun 2018 05:54:54 +0000 (22:54 -0700)
xsl/fo/table.xsl

index fb820bb9c4a7bec45f4b95750fcfa3e8de14bbd9..9a1e3cfbc8f56ed665eacd5b6bc9e2752078caee 100644 (file)
 <!-- ==================================================================== -->
 
 <xsl:template name="calsTable">
+  <xsl:apply-templates select="d:tgroup|d:mediaobject|d:graphic" mode="calsTable"/>
+  <xsl:apply-templates select="d:caption"/>
+</xsl:template>
 
+<xsl:template match="d:tgroup" mode="calsTable">
   <xsl:variable name="keep.together">
     <xsl:call-template name="pi.dbfo_keep-together"/>
   </xsl:variable>
+  <fo:table xsl:use-attribute-sets="table.table.properties">
+    <xsl:if test="$keep.together != ''">
+      <xsl:attribute name="keep-together.within-column">
+        <xsl:value-of select="$keep.together"/>
+      </xsl:attribute>
+    </xsl:if>
+    <xsl:call-template name="table.frame"/>
+    <xsl:if test="following-sibling::d:tgroup">
+      <xsl:attribute name="border-bottom-width">0pt</xsl:attribute>
+      <xsl:attribute name="border-bottom-style">none</xsl:attribute>
+      <xsl:attribute name="padding-bottom">0pt</xsl:attribute>
+      <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
+      <xsl:attribute name="space-after">0pt</xsl:attribute>
+      <xsl:attribute name="space-after.minimum">0pt</xsl:attribute>
+      <xsl:attribute name="space-after.optimum">0pt</xsl:attribute>
+      <xsl:attribute name="space-after.maximum">0pt</xsl:attribute>
+    </xsl:if>
+    <xsl:if test="preceding-sibling::d:tgroup">
+      <xsl:attribute name="border-top-width">0pt</xsl:attribute>
+      <xsl:attribute name="border-top-style">none</xsl:attribute>
+      <xsl:attribute name="padding-top">0pt</xsl:attribute>
+      <xsl:attribute name="margin-top">0pt</xsl:attribute>
+      <xsl:attribute name="space-before">0pt</xsl:attribute>
+      <xsl:attribute name="space-before.minimum">0pt</xsl:attribute>
+      <xsl:attribute name="space-before.optimum">0pt</xsl:attribute>
+      <xsl:attribute name="space-before.maximum">0pt</xsl:attribute>
+    </xsl:if>
+    <xsl:apply-templates select="."/>
+  </fo:table>
+</xsl:template>
 
-  <xsl:for-each select="d:tgroup">
-
-    <fo:table xsl:use-attribute-sets="table.table.properties">
-      <xsl:if test="$keep.together != ''">
-        <xsl:attribute name="keep-together.within-column">
-          <xsl:value-of select="$keep.together"/>
-        </xsl:attribute>
-      </xsl:if>
-      <xsl:call-template name="table.frame"/>
-      <xsl:if test="following-sibling::d:tgroup">
-        <xsl:attribute name="border-bottom-width">0pt</xsl:attribute>
-        <xsl:attribute name="border-bottom-style">none</xsl:attribute>
-        <xsl:attribute name="padding-bottom">0pt</xsl:attribute>
-        <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
-        <xsl:attribute name="space-after">0pt</xsl:attribute>
-        <xsl:attribute name="space-after.minimum">0pt</xsl:attribute>
-        <xsl:attribute name="space-after.optimum">0pt</xsl:attribute>
-        <xsl:attribute name="space-after.maximum">0pt</xsl:attribute>
-      </xsl:if>
-      <xsl:if test="preceding-sibling::d:tgroup">
-        <xsl:attribute name="border-top-width">0pt</xsl:attribute>
-        <xsl:attribute name="border-top-style">none</xsl:attribute>
-        <xsl:attribute name="padding-top">0pt</xsl:attribute>
-        <xsl:attribute name="margin-top">0pt</xsl:attribute>
-        <xsl:attribute name="space-before">0pt</xsl:attribute>
-        <xsl:attribute name="space-before.minimum">0pt</xsl:attribute>
-        <xsl:attribute name="space-before.optimum">0pt</xsl:attribute>
-        <xsl:attribute name="space-before.maximum">0pt</xsl:attribute>
-      </xsl:if>
-      <xsl:apply-templates select="."/>
-    </fo:table>
-
-    <xsl:for-each select="d:mediaobject|d:graphic">
-      <xsl:apply-templates select="."/>
-    </xsl:for-each>
-
-  </xsl:for-each>
-
-  <xsl:apply-templates select="d:caption"/>
-
+<xsl:template match="d:mediaobject|d:graphic" mode="calsTable">
+  <xsl:apply-templates select="."/>
 </xsl:template>
 
 <!-- ==================================================================== -->