]> granicus.if.org Git - docbook-dsssl/commitdiff
Fix bug 3441149 where mode="class.value" does not work
authorBob Stayton <bobs@sagehill.net>
Thu, 24 Nov 2011 00:12:16 +0000 (00:12 +0000)
committerBob Stayton <bobs@sagehill.net>
Thu, 24 Nov 2011 00:12:16 +0000 (00:12 +0000)
for para or entry when the element does not have a role attribute.

xsl/html/block.xsl
xsl/html/html.xsl
xsl/html/table.xsl

index 3d755b611d235a9578b409c7a7bb65a6dccfa2d9..41aef864132c09cea5ff6f2d68ade83b7621a436 100644 (file)
@@ -64,7 +64,9 @@
           </xsl:call-template>
         </xsl:when>
         <xsl:otherwise>
-          <xsl:call-template name="locale.html.attributes"/>
+          <xsl:call-template name="common.html.attributes">
+            <xsl:with-param name="class" select="''"/>
+          </xsl:call-template>
         </xsl:otherwise>
       </xsl:choose>
       <xsl:copy-of select="$content"/>
index df14f43dd4d8747a3e23533e7e0bcb5def9c48fe..541424adec562a8efb0e5382fbd8659aa41d0423 100644 (file)
   <xsl:param name="class" select="local-name(.)"/>
   <!-- permit customization of class attributes -->
   <!-- Use element name by default -->
-  <xsl:attribute name="class">
+  <xsl:variable name="class.value">
     <xsl:apply-templates select="." mode="class.value">
       <xsl:with-param name="class" select="$class"/>
     </xsl:apply-templates>
-  </xsl:attribute>
+  </xsl:variable>
+
+  <xsl:if test="string-length(normalize-space($class.value)) != 0">
+    <xsl:attribute name="class">
+      <xsl:value-of select="$class.value"/>
+    </xsl:attribute>
+  </xsl:if> 
 </xsl:template>
 
 <xsl:template match="*" mode="class.value">
index 6e47b55ecf14a1f041d878cdc1f1691a0403e67f..82b38fc31391931681b4079e4e3e7d1c91b25505 100644 (file)
         </xsl:if>
 
         <xsl:call-template name="locale.html.attributes"/>
-        <xsl:if test="$entry.propagates.style != 0 and @role">
-          <xsl:apply-templates select="." mode="class.attribute">
-            <xsl:with-param name="class" select="@role"/>
-          </xsl:apply-templates>
-        </xsl:if>
+        <xsl:choose>
+          <xsl:when test="$entry.propagates.style != 0 and @role">
+            <xsl:apply-templates select="." mode="class.attribute">
+              <xsl:with-param name="class" select="@role"/>
+            </xsl:apply-templates>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:apply-templates select="." mode="class.attribute">
+              <xsl:with-param name="class" select="''"/>
+            </xsl:apply-templates>
+          </xsl:otherwise>
+        </xsl:choose>
 
         <xsl:if test="$show.revisionflag and @revisionflag">
           <xsl:attribute name="class">