forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jo...@apache.org
Subject svn commit: r358335 - /forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
Date Wed, 21 Dec 2005 17:48:49 GMT
Author: josch
Date: Wed Dec 21 09:48:39 2005
New Revision: 358335

URL: http://svn.apache.org/viewcvs?rev=358335&view=rev
Log:
avoid unnecessary spaces in @class (see last commit)

Modified:
    forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl

Modified: forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
URL: http://svn.apache.org/viewcvs/forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl?rev=358335&r1=358334&r2=358335&view=diff
==============================================================================
--- forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
(original)
+++ forrest/branches/forrest_07_branch/main/webapp/skins/common/xslt/html/document2html.xsl
Wed Dec 21 09:48:39 2005
@@ -137,8 +137,10 @@
 
   <xsl:template match="note | warning | fixme">
     <xsl:apply-templates select="@id"/>
-    <div class="{@class}">
-    <div class="frame {local-name()}">
+    <div>
+      <xsl:call-template name="add.class">
+        <xsl:with-param name="class"><xsl:value-of select="local-name()"/></xsl:with-param>
+      </xsl:call-template>
       <div class="label">
         <xsl:choose>
           <!-- FIXME: i18n Transformer here -->
@@ -152,7 +154,6 @@
         <xsl:apply-templates/>
       </div>
     </div>
-    </div>
   </xsl:template>
 
   <xsl:template match="notice">
@@ -229,7 +230,10 @@
 
   <xsl:template match="code">
     <xsl:apply-templates select="@id"/>
-    <span class="codefrag {@class}">
+    <span>
+      <xsl:call-template name="add.class">
+        <xsl:with-param name="class">codefrag</xsl:with-param>
+      </xsl:call-template>
       <xsl:copy-of select="@id"/>
       <xsl:value-of select="."/>
     </span>
@@ -379,6 +383,24 @@
         <xsl:with-param name="level" select="$level+1"/>
       </xsl:apply-templates>
     </tocitem>
+  </xsl:template>
+
+  <xsl:template name="add.class">
+    <!-- use the parameter to set class attribute -->
+    <!-- if there are already classes set, adds to them -->
+    <xsl:param name="class"/> 
+    <xsl:attribute name="class">
+      <xsl:choose>
+        <xsl:when test="@class">
+          <xsl:value-of select="$class"/>
+          <xsl:text> </xsl:text>
+          <xsl:value-of select="@class"/>
+        </xsl:when>
+        <xsl:otherwise>
+          <xsl:value-of select="$class"/>
+        </xsl:otherwise>
+      </xsl:choose> 
+    </xsl:attribute>
   </xsl:template>
 
   <xsl:template match="node()|@*" mode="toc"/>



Mime
View raw message