[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
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/
|
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
|