]> granicus.if.org Git - docbook-dsssl/commitdiff
Use table 'tabstyle' attribute for div class
authorNorman Walsh <ndw@nwalsh.com>
Tue, 8 Oct 2002 14:05:35 +0000 (14:05 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Tue, 8 Oct 2002 14:05:35 +0000 (14:05 +0000)
xsl/html/formal.xsl

index 74a0e0760b48ee2bd3cc52a07d2600b3464b7fd8..04ca27e11f3f9c04b1cedff881ad3f110a45e9ea 100644 (file)
@@ -14,8 +14,9 @@
 
 <xsl:template name="formal.object">
   <xsl:param name="placement" select="'before'"/>
+  <xsl:param name="class" select="local-name(.)"/>
 
-  <div class="{name(.)}">
+  <div class="{$class}">
     <xsl:call-template name="anchor">
       <xsl:with-param name="conditional" select="0"/>
     </xsl:call-template>
@@ -61,7 +62,9 @@
 </xsl:template>
 
 <xsl:template name="informal.object">
-  <div class="{name(.)}">
+  <xsl:param name="class" select="local-name(.)"/>
+
+  <div class="{$class}">
     <xsl:if test="$spacing.paras != 0"><p/></xsl:if>
     <xsl:call-template name="anchor"/>
     <xsl:apply-templates/>
 
 <xsl:template name="semiformal.object">
   <xsl:param name="placement" select="'before'"/>
+  <xsl:param name="class" select="local-name(.)"/>
+
   <xsl:choose>
     <xsl:when test="title">
       <xsl:call-template name="formal.object">
         <xsl:with-param name="placement" select="$placement"/>
+        <xsl:with-param name="class" select="$class"/>
       </xsl:call-template>
     </xsl:when>
     <xsl:otherwise>
-      <xsl:call-template name="informal.object"/>
+      <xsl:call-template name="informal.object">
+        <xsl:with-param name="class" select="$class"/>
+      </xsl:call-template>
     </xsl:otherwise>
   </xsl:choose>
 </xsl:template>
 
   <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>
 
 <xsl:template match="informaltable">
-  <xsl:call-template name="informal.object"/>
+  <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:template>
 
 <xsl:template match="informaltable/textobject"></xsl:template>