cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marc Salvetti <m...@notremanou.net>
Subject Re: modifying the style of required widgets in CForms
Date Thu, 20 Jan 2005 07:45:58 GMT


Mark Lundquist a écrit :

> Thanks for the detail.  See below:
>
> On Jan 19, 2005, at 10:20 PM, Marc Salvetti wrote:
>
>> I tried your last suggestion, but that doesn't seem to help,
>> so here is what the custom-styling stylesheet looks like so far :
>>
>> <?xml version="1.0"?>
>>
>> <xsl:stylesheet version="1.0"
>>                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>                xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
>>                xmlns:exsl="http://exslt.org/common" >
>>
>> <xsl:import href="../resources/forms-samples-styling.xsl" />
>>
>> <xsl:template match="*" mode="custom-styling">
>>    <xsl:param name="required" />
>>    <xsl:copy>
>
>     <!-- You forgot to add this (see my eariler email): -->
>     <xsl:apply-templates select="@* />

>     <!-- That's why the attributes, e.g. 'rows' & 'cols' are lost... -->

I tried it before but it didn't work, that's why i removed it...

>>        <xsl:if test="$required='true'">
>>            <xsl:attribute name="class">required-field</xsl:attribute>
>>        </xsl:if>
>>    </xsl:copy>
>> </xsl:template>
>>
>> <xsl:template match="fi:field" mode="styling">
>>    <!-- Apply the default transformation -->
>>    <xsl:variable name="control">
>>        <xsl:apply-imports/>
>>    </xsl:variable>
>>    <!-- Now apply our styling -->
>>    <xsl:apply-templates select="exsl:node-set($control)" 
>> mode="custom-styling">
>
>         <!-- d'oh, my bad!
>
>>        <xsl:with-param name="required" value="@required" />
>
>        That should be:
>        -->
>           <xsl:with-param name="required" select="@required" />

all right! one error solved (btw, why doesn't it produce an exception 
with value ?)

>
>>    </xsl:apply-templates>
>> </xsl:template>
>>
>> </xsl:stylesheet>
>
>
> Give that a shot! :-)

well, same same as they say here :-)

html output :

<textarea title="" name="comment" id="comment"/>
<span class="forms-field-required"> * </span>


Cheers,

Marc

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message