xsl-list
[Top] [All Lists]

RE: passing parameters to templates

2003-06-16 14:26:09
That works but I cannot use it that way.  Is it possible to pass the
parameter using just <xsl:apply-templates/> not having to select a
specific template to pass the parameter to?

Tim Bachta
 

-----Original Message-----
From: J.Pietschmann [mailto:j3322ptm(_at_)yahoo(_dot_)de] 
Sent: Monday, June 16, 2003 4:10 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] passing parameters to templates

Tim Bachta wrote:
Tried that with no luck.

This probably means no parameter was passed to the template.
You'll have to have a
  <xsl:apply-templates select="...">
    <xsl:with-param name="report_name" select="'foo'"/>
  </xsl:apply-templates>
which selects a BeginEndDate to match.

In your case either you never passed a parameter to any
template, or there was a default template interfering.

It is best to learn how to use template parameters with
small test cases rather than full blown production code.

If you want to use a stylesheet parameter, define the
<xsl:param> as child of <xsl:stylesheet>. You still have
to pass the parameter value from the outside using a processor
specific mechanism.

J.Pietschmann



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>