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

Re: Evaluate string as XPATH axis in XSLT1.0?

Subject: Re: Evaluate string as XPATH axis in XSLT1.0?
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Mon, 20 Aug 2007 08:33:13 +0200
Re:  Evaluate string as XPATH axis in XSLT1.0?
Matt Poff wrote:
Hi,

I'm trying to resolve a node attribute which contains an XPATH fragment to actually resolve that path to a value. Is this possible.

XML with attribute looks like...

<grid-map map="./foo[@bar]/select" />


XSLT looks like...
<xsl:variable name="path" select="../grid/grid-map[1]/@map"/>
<xsl:value-of select="{$path}" />

the select-attribute is not an AVT and in general, an XPath cannot be interpreted, it is static. The "normal" way to go about this is to create a stylesheet that creates a (temporary) second stylesheet with the xpaths from your source and then apply that new stylesheet. Another way is to use extension functions (Saxon for one has extensions that work both in XSLT 1.0 and 2.0 that can do this).


Cheers,
-- Abel Braaksma

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.