[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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 ***
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|