Re: [xsl] initial template parameters

Subject: Re: [xsl] initial template parameters
From: Wolfgang Laun <wolfgang.laun@xxxxxxxxx>
Date: Thu, 18 Mar 2010 07:48:14 +0100
On Thu, Mar 18, 2010 at 6:29 AM, Max Toro <maxtoroq@xxxxxxxxx> wrote:
> "Parameters passed to the transformation by the client application are
> matched against stylesheet parameters (see 9.5 Global Variables and
> Parameters), not against the template parameters declared within the
> initial template. All template parameters within the initial template
> to be executed will take their default values."
>
> Why? :-(

Because that would result in different ways of dealing with the values
passed in from the invocation, depending on whether you specify an
initial template or not: Not using an initial template would require them
to go to the stylesheet's parameter set; otherwise they'd have to be
passed straight to the template.

If you want the parameters passed to the template, you can always do

<xsl:param name="pp1" select="42"/>

<xsl:template name="init">
  <xsl:param name="tp1" select="$pp1"/>
  tp1=<xsl:value-of select="$tp1"/>
</xsl:template>

which will let you pass a value, via pp1, into template "init".

Why does this bother you?

-W

Current Thread