You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by Johannes Schaefer <jo...@uidesign.de> on 2005/12/21 18:11:22 UTC

Re: svn commit: r358325 - /forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl

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

Re: svn commit: r358325 - /forrest/trunk/main/webapp/skins/common/xslt/html/document-to-html.xsl

Posted by David Crossley <cr...@apache.org>.
Johannes Schaefer wrote:
> now, if everybody agrees I'll need to backport this to 0.7

You don't really need to ask. Add whatever changes that
you see fit. Just ensure that any changes have also 
been made to trunk.

The default is that we don't bother reflecting any new
stuff into the branch. If a developer has a need then
they can send a patch. Ideally this is an 'svn merge'
so we get the exact same changes that were done in trunk.

-David