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... -->
       <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" />

   </xsl:apply-templates>
</xsl:template>

</xsl:stylesheet>

Give that a shot! :-) —ml—


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



Reply via email to