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

Re: Dynamic XPath

Subject: Re: Dynamic XPath
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 23 May 2003 16:30:14 +0100
dynamic xpath
> Which then changes the result of   <xsl:variable name="textContent"
> select="{$dynamicPath}/text()" />

but why do you want this (which as you say doesn't work) rather than

<xsl:variable name="textContent"
select="$dynamicPath/text()" />

which does work if you defined it by

	<xsl:variable
name="dynamicPath" select="/document/section/keep/pear"/>

rather than

	<xsl:variable
name="dynamicPath">/document/section/keep/pear</xsl:variable>


Dynamic evaluation is rather expensive, people seem to expect it to be
in XSLT for some reaon, but I doubt many people expect a C compiler to
accept C strings that contain random bits of C expression and somehow
inline the strings into the surrounding expression.


If you really do need to have the strings constructed and evaluated
dynamically (which is not at all clear from your examples)
then the pure xslt way is to generate a stylesheet that uses the
constructed Xpath and execute the new stylesheet.
To avoid that, some systems have an evaluate() extension function in their
extension namespace (saxon does).

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
________________________________________________________________________

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.