]> granicus.if.org Git - docbook-dsssl/commitdiff
Add table.row.properties template to customize table rows.
authorBob Stayton <bobs@sagehill.net>
Sat, 6 Jan 2007 18:31:14 +0000 (18:31 +0000)
committerBob Stayton <bobs@sagehill.net>
Sat, 6 Jan 2007 18:31:14 +0000 (18:31 +0000)
xsl/fo/table.xsl

index 691d89ff6e478931436238dd08f121c65f8e91d2..8ea5501be4be522b0d0349e9c4bfed04fed58fde 100644 (file)
@@ -686,36 +686,36 @@ to be incomplete. Don't forget to read the source, too :-)</para>
   <xsl:choose>
     <xsl:when test="contains($spans, '0')">
       <xsl:call-template name="normal-row">
-       <xsl:with-param name="spans" select="$spans"/>
+        <xsl:with-param name="spans" select="$spans"/>
       </xsl:call-template>
     </xsl:when>
     <xsl:otherwise>
       <!--
       <xsl:message>
-       <xsl:text>Ignoring row: </xsl:text>
-       <xsl:value-of select="$spans"/>
-       <xsl:text> = </xsl:text>
-       <xsl:call-template name="consume-row">
-         <xsl:with-param name="spans" select="$spans"/>
-       </xsl:call-template>
+        <xsl:text>Ignoring row: </xsl:text>
+        <xsl:value-of select="$spans"/>
+        <xsl:text> = </xsl:text>
+        <xsl:call-template name="consume-row">
+          <xsl:with-param name="spans" select="$spans"/>
+        </xsl:call-template>
       </xsl:message>
       -->
 
       <xsl:if test="normalize-space(.//text()) != ''">
-       <xsl:message>Warning: overlapped row contains content!</xsl:message>
+        <xsl:message>Warning: overlapped row contains content!</xsl:message>
       </xsl:if>
 
       <fo:table-row>
-       <xsl:comment> This row intentionally left blank </xsl:comment>
-       <fo:table-cell><fo:block/></fo:table-cell>
+        <xsl:comment> This row intentionally left blank </xsl:comment>
+        <fo:table-cell><fo:block/></fo:table-cell>
       </fo:table-row>
 
       <xsl:apply-templates select="following-sibling::row[1]">
-       <xsl:with-param name="spans">
-         <xsl:call-template name="consume-row">
-           <xsl:with-param name="spans" select="$spans"/>
-         </xsl:call-template>
-       </xsl:with-param>
+        <xsl:with-param name="spans">
+          <xsl:call-template name="consume-row">
+            <xsl:with-param name="spans" select="$spans"/>
+          </xsl:call-template>
+        </xsl:with-param>
       </xsl:apply-templates>
     </xsl:otherwise>
   </xsl:choose>
@@ -724,20 +724,9 @@ to be incomplete. Don't forget to read the source, too :-)</para>
 <xsl:template name="normal-row">
   <xsl:param name="spans"/>
 
-  <xsl:variable name="bgcolor">
-    <xsl:call-template name="dbfo-attribute">
-      <xsl:with-param name="pis" select="processing-instruction('dbfo')"/>
-      <xsl:with-param name="attribute" select="'bgcolor'"/>
-    </xsl:call-template>
-  </xsl:variable>
-
   <fo:table-row>
+    <xsl:call-template name="table.row.properties"/>
     <xsl:call-template name="anchor"/>
-    <xsl:if test="$bgcolor != ''">
-      <xsl:attribute name="background-color">
-        <xsl:value-of select="$bgcolor"/>
-      </xsl:attribute>
-    </xsl:if>
 
     <xsl:apply-templates select="(entry|entrytbl)[1]">
       <xsl:with-param name="spans" select="$spans"/>
@@ -757,6 +746,22 @@ to be incomplete. Don't forget to read the source, too :-)</para>
   </xsl:if>
 </xsl:template>
 
+<!-- customize this template to add row properties -->
+<xsl:template name="table.row.properties">
+  <xsl:variable name="bgcolor">
+    <xsl:call-template name="dbfo-attribute">
+      <xsl:with-param name="pis" select="processing-instruction('dbfo')"/>
+      <xsl:with-param name="attribute" select="'bgcolor'"/>
+    </xsl:call-template>
+  </xsl:variable>
+  <xsl:if test="$bgcolor != ''">
+    <xsl:attribute name="background-color">
+      <xsl:value-of select="$bgcolor"/>
+    </xsl:attribute>
+  </xsl:if>
+
+</xsl:template>
+
 <xsl:template match="entry|entrytbl" name="entry">
   <xsl:param name="col" select="1"/>
   <xsl:param name="spans"/>