[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: 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
|
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
|