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>
       <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">
<xsl:with-param name="required" value="@required" />
</xsl:apply-templates>
</xsl:template>


</xsl:stylesheet>

here is the example widget i'm testing on :

   <ft:widget id="comment">
       <fi:styling type="textarea" cols="80" rows="10" />
   </ft:widget>

here is the resulting html :

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

textarea is applied no pb,
cols and rows attributes are lost,
class="required-filed" is not copied.

Maybe you can see better where is the problem ?

Thanks for your help

Marc


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to