xsl-list
[Top] [All Lists]

RE: [xsl] Tunnelled params and variables

2007-07-27 08:08:45
Tunnel="yes" allows params to be passed transparently from one template
to another, regardless of the number of template matches in between.

Set tunnel="yes" on the with-param when calling or applying templates,
set tunnel="yes" in the receiving stylesheet.

<a>1</a>
<b>
  <c>something</c>
</b>

<xsl:template match="a">
  <xsl:variable name="c" select="a+1"/>

  <xsl:apply-templates>
     <xsl:with-param name="count" select="$c" tunnel="yes"/>
  </xsl:apply-templates>
</xsl:template>

<xsl:template match="b">
  ... Something ...
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="c">
  <xsl:param name="count" tunnel="yes"/>

  <xsl:value-of select="$count"/>
</xsl:template>


  


Thanks!
Angela 

-----Original Message-----
From: Justin Johansson [mailto:procode(_at_)tpg(_dot_)com(_dot_)au] 
Sent: Friday, July 27, 2007 10:24 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Tunnelled params and variables

What are the use cases for having tunnel="yes" on xsl:params and
variables?

It must be in the spec for some good reason, though I hestisate using
the feature fearing that the use thereof may lead to a poor programming
practice.

I well remember the list's attitude to local functions had these been
allowed in XSLT.

Thanks for the insight,
Justin Johansson

*** A horse with no name is called Lambda ***

--~------------------------------------------------------------------
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>
--~--

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