cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Lundquist>
Subject Re: modifying the style of required widgets in CForms
Date Thu, 20 Jan 2005 05:29:40 GMT

On Jan 19, 2005, at 7:29 PM, Marc Salvetti wrote:

> nope ! lost your bet, the result is just exactly the same :-\


> i tried this instead :
>    <xsl:copy-of select=".">
>        <xsl:if test="$required='true'">
>            <xsl:attribute name="class">required-field</xsl:attribute>
>        </xsl:if>
>    </xsl:copy-of>
> and this copies all the attributes of the <fi:styling> tag to the 
> control (even the type="textarea" which is not supposed to be...) but 
> the class="required-filed" is still not copied !

Well, check the reference on <xml:copy-of>... its contents are always 

Can you show your whole stylesheet?  There should be no <fi:styling> 
element left by the time you get to the "custom-styling" moded 
template, because we're invoking it on the result of applying the 
imported template which has already translated the fi:* to HTML.

> Then i wonder (again) if we are matching the correct element. I think 
> maybe we are matching the fi:field element where we should match the 
> fi:styling... or the opposite :-D

We _do_ want to match fi:field — in the wrapper template (the one that 
does the <apply-imports>). This template  has mode="styling", so it 
only matches for <apply-templates mode="styling">.

But I think I see the problem... we're also going to match all kinds of 
other stuff for which there are specific templates in 
forms-field-styling.  My bad again!  So the wrapper template should 
match="fi:field", not fi:*.  Give that a try... but if it doesn't work, 
let's have a look at your whole stylesheet! :-)


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message