]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix bug 3116969 where mode="class.value" customization
authorBob Stayton <bobs@sagehill.net>
Fri, 26 Nov 2010 07:28:53 +0000 (07:28 +0000)
committerBob Stayton <bobs@sagehill.net>
Fri, 26 Nov 2010 07:28:53 +0000 (07:28 +0000)
did not work for table or informaltable.

xsl/html/formal.xsl

index b4909b7514afa83196a09f925fa7c06b70667045..76190b3a41cb2cf8c8f5b5cbe9bdf0daaa498047 100644 (file)
 </xsl:template>
 
 <xsl:template name="informal.object">
-  <xsl:param name="class" select="local-name(.)"/>
+  <xsl:param name="class">
+    <xsl:apply-templates select="." mode="class.value"/>
+  </xsl:param>
 
   <xsl:variable name="content">
     <div class="{$class}">
 
   <xsl:call-template name="formal.object">
     <xsl:with-param name="placement" select="$placement"/>
-    <xsl:with-param name="class">
-      <xsl:choose>
-        <xsl:when test="@tabstyle">
-          <!-- hack, this will only ever occur on table, not example -->
-          <xsl:value-of select="@tabstyle"/>
-        </xsl:when>
-        <xsl:otherwise>
-          <xsl:value-of select="local-name(.)"/>
-        </xsl:otherwise>
-      </xsl:choose>
-    </xsl:with-param>
   </xsl:call-template>
 </xsl:template>
 
+<xsl:template match="table|informaltable" mode="class.value">
+  <xsl:choose>
+    <xsl:when test="@tabstyle">
+      <xsl:value-of select="@tabstyle"/>
+    </xsl:when>
+    <xsl:otherwise>
+      <xsl:value-of select="local-name(.)"/>
+    </xsl:otherwise>
+  </xsl:choose>
+</xsl:template>
+
 <xsl:template name="htmlTable">
   <xsl:if test="tgroup/tbody/row
                 |tgroup/thead/row
 <xsl:template match="informaltable">
   <xsl:choose>
     <xsl:when test="tgroup|mediaobject|graphic">
-      <xsl:call-template name="informal.object">
-        <xsl:with-param name="class">
-          <xsl:choose>
-            <xsl:when test="@tabstyle">
-              <xsl:value-of select="@tabstyle"/>
-            </xsl:when>
-            <xsl:otherwise>
-              <xsl:value-of select="local-name(.)"/>
-            </xsl:otherwise>
-          </xsl:choose>
-        </xsl:with-param>
-      </xsl:call-template>
+      <xsl:call-template name="informal.object"/>
     </xsl:when>
     <xsl:otherwise>
       <xsl:element name="table" namespace="">