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

Re: Binding or re-binding tunnel parameters in the mid

Subject: Re: Binding or re-binding tunnel parameters in the middle of a template
From: Andrew Welch <andrew.j.welch@xxxxxxxxx>
Date: Tue, 22 Dec 2009 17:30:26 +0000
Re:  Binding or re-binding tunnel parameters in the mid
The short answer is no, but I also don't really see it as a problem...
 if you spent much time passing parameters down through templates in
xslt 1.0 you would love tunnelled parameters in 2.0!

2009/12/22 Greg Beauchesne <greg.beauchesne@xxxxxxxxx>:
> Hello,
>
> I'm writing a transform that makes extensive use of tunnel parameters.
> In some cases, I find myself making a series of calls to which the same
> tunnel parameter is passed but which is not yet tunneled until the call
> itself (often times this is a modified version of the tunnel parameter
> that was passed in, but that's not really relevant here; just some
> background info):
>
> -----
> <xsl:template name="template">
>   <xsl:variable name="value" select="..." />
>
>   <xsl:call-template name="tunnelTemplate">
>     <xsl:with-param name="tunnelParam" select="$value" tunnel="yes" />
>   </xsl:call-template>
>   <xsl:call-template name="anotherTunnelTemplate">
>     <xsl:with-param name="tunnelParam" select="$value" tunnel="yes" />
>   </xsl:call-template>
>   <xsl:call-template name="yetAnotherTunnelTemplate">
>     <xsl:with-param name="tunnelParam" select="$value" tunnel="yes" />
>   </xsl:call-template>
> </xsl:template>
> -----
>
> Is there any simpler way of reusing that tunnel parameter without having
> to type the xsl:with-param over and over again other than wrapping that
> whole section in another template and calling that? e.g.:
>
> -----
> <xsl:template name="template">
>   <xsl:variable name="value" select="..." />
>
>   <xsl:call-template name="subTemplate">
>     <xsl:with-param name="tunnelParam" select="$value" tunnel="yes" />
>   </xsl:call-template>
> </xsl:template>
>
> <xsl:template name="subTemplate">
>   <xsl:call-template name="tunnelTemplate" />
>   <xsl:call-template name="anotherTunnelTemplate" />
>   <xsl:call-template name="yetAnotherTunnelTemplate" />
> </xsl:template>
> -----
>
> Removing the additional with-params would improve readability, but it
> would also be helpful to be able keep all the calls in one template.
> That would also mean I would not have to pass in any additional
> variables that were defined in "template".
>
> -- Greg
>
>



--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.