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

Re: Variable scope when using imported stylesheets

Subject: Re: Variable scope when using imported stylesheets
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 24 Aug 2004 14:56:51 +0100
Re:  Variable scope when using imported stylesheets
It's not totally clear what your requirements are but I think that you
are making the mistake (common for some reason) of thinking of variables
as holding Xpath expressions, they don't; they hold _values_ (node sets
in your case) so if you have a variable binding such as

<xsl:variable
   name="ImpVehData"
   select="FileRefEval/FileRefVehData"
/>


Then the value of $ImpVehData is whatever node set results in evaluating
that xpath __at the point of the declaration__. In common with most
programming languages, XSLT can not store an arbitrary expression in a
variable that you may re-evaluate, getting different results in different
contexts.

the smallest unit that you can re-evaluate in that way is a named
template. Calling a named template will cause the body of the template
to be evaluate in a context determined by the call.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.