[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Tunnelled params and variables

Subject: RE: Tunnelled params and variables
From: "Angela Williams" <Angela.Williams@xxxxxxxxxxxxxxxxxx>
Date: Fri, 27 Jul 2007 10:08:24 -0500
RE:  Tunnelled params and variables
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@xxxxxxxxxx]
Sent: Friday, July 27, 2007 10:24 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  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 ***

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.