forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johannes Schaefer <johannes.schae...@uidesign.de>
Subject Re: svn commit: r358325 - /forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl
Date Wed, 21 Dec 2005 17:11:22 GMT
now, if everybody agrees I'll need to backport this to 0.7
Johannes

josch@apache.org schrieb:
> Author: josch
> Date: Wed Dec 21 08:55:12 2005
> New Revision: 358325
> 
> URL: http://svn.apache.org/viewcvs?rev=358325&view=rev
> Log:
> added new template "add.class" 
> * adds a class w/o removing previously set classes and
> * w/o inserting unnecessary blanks
> applied it to <note> et al. and <code>
> 
> Modified:
>     forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl
> 
> Modified: forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl
> URL: http://svn.apache.org/viewcvs/forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl?rev=358325&r1=358324&r2=358325&view=diff
> ==============================================================================
> --- forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl (original)
> +++ forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl Wed Dec 21
08:55:12 2005
> @@ -137,7 +137,10 @@
>  
>    <xsl:template match="note | warning | fixme">
>      <xsl:apply-templates select="@id"/>
> -    <div class="{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 -->
> @@ -228,12 +231,9 @@
>    <xsl:template match="code">
>      <xsl:apply-templates select="@id"/>
>      <span>
> -      <xsl:attribute name="class">
> -        <xsl:choose>
> -          <xsl:when test="@class">codefrag <xsl:value-of select="@class"/></xsl:when>
> -          <xsl:otherwise>codefrag</xsl:otherwise>
> -        </xsl:choose> 
> -      </xsl:attribute>
> +      <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>
> @@ -383,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"/>
> 
> 
> 


-- 
User Interface Design GmbH * Teinacher Str. 38 * D-71634 Ludwigsburg
Fon +49 (0)7141 377 000 * Fax  +49 (0)7141 377 00-99
Geschäftsstelle: User Interface Design GmbH * Lehrer-Götz-Weg 11 *
D-81825 München
www.uidesign.de

Buch "User Interface Tuning" von Joachim Machate & Michael Burmester
www.user-interface-tuning.de

Mime
View raw message