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

Re: Template matching on tunnelled variables

Subject: Re: Template matching on tunnelled variables
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Fri, 17 Feb 2012 08:48:57 +0000
Re:  Template matching on tunnelled variables
On 17/02/2012 04:27, ihe onwuka wrote:
AFAIK this doesn't work. Why?


Are you asking: why cannot I refer to the value of a tunnel parameter within the match pattern of a template?

If so, I agree it would be useful, but the design would be awkward. We would have to decide whether the variable needs to be declared in the xsl:param elements. If so, having a variable reference before the variable declaration would feel strange. If not, allowing a reference to an undeclared variable in the match pattern but not in the template body would feel strange. It's also difficult to introduce retrospectively because a variable in the match pattern is currently defined to refer to global variables.

It would also prevent some optimizations, which might be important to some implementors. Currently during the course of a single transformation, if you do apply-templates twice on the same node in the same mode, the same template rule is matched each time; this invariant would no longer hold. Since XSLT performance depends critically on being smart in the way template pattern matching works, this could be significant (though not for Saxon).

Michael Kay
Saxonica

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.