cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Boag/CAM/Lotus" <Scott_B...@lotus.com>
Subject Re: Passing Parameters
Date Thu, 06 Jan 2000 01:08:08 GMT

Just a raw, untested guess from a brief glance, but I think this should
look like:

<xsl:apply-templates select="/data/table[@name='profile_value_code']/row">
  <xsl:with-param name="sample">
    <xsl:value-of select="column[@name='profile_value_cd']"/>
  </xsl:with-param>
</xsl:apply-templates>

<xsl:template match="row[@name='profile_value_code']">
  <xsl:param name="sample">
    <xsl:value-of select="column[@name='profile_value_cd']"/>
  </xsl:param>
  <xsl:value-of select="$sample"/>
</xsl:template>

I don't understand what the curly braces were supposed to be doing in your
sample...  (Curly braces normally designate Attribute Value Templates,
which are generally only allowed for Literal Result attributes, and for
only a few xsl attributes...  for select attributes and the like you don't
need and shouldn't have the curly braces...).

-scott




                                                                                         
                             
                    Andy Egleston                                                        
                             
                    <Andy.Egleston@TR        To:     "Cocoon-Dev (E-mail)" <cocoon-dev@xml.apache.org>
                
                    ISECT.com>               cc:     (bcc: Scott Boag/CAM/Lotus)      
                                
                                             Subject:     Passing Parameters             
                             
                    01/05/00 09:52 AM                                                    
                             
                    Please respond to                                                    
                             
                    cocoon-dev                                                           
                             
                                                                                         
                             
                                                                                         
                             




Hi,

I'm having trouble trying to pass a parameter to a template:  The templates
are matching correctly.  Everything is working OK except the parameter
passing.  I have looked extensively at the examples and I must be missing
something.  Thanks.  Here is the code:


<xsl:apply-templates select="/data/table[@name='profile_value_code']/row">
  <xsl:with-param name="sample">
    <xsl:value-of select="{column[@name='profile_value_cd']}"/>
  </xsl:with-param>
</xsl:apply-templates>

<xsl:template match="row[@name='profile_value_code']">
  <xsl:param name="sample">
    <xsl:value-of select="{column[@name='profile_value_cd']}"/>
  </xsl:param>
  <xsl:value-of select="{$sample}"/>
</xsl:template>



Andy Egleston





Mime
View raw message