xsl-list
[Top] [All Lists]

Re: [xsl] initial template parameters

2010-03-18 01:48:41
On Thu, Mar 18, 2010 at 6:29 AM, Max Toro <maxtoroq(_at_)gmail(_dot_)com> 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


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--