Subject: Re: [xsl] Evaluate string as XPATH axis in XSLT1.0? From: Matt Poff <matt.poff@xxxxxxxxxxxxxxx> Date: Tue, 21 Aug 2007 11:58:18 +1200 |
[One] <xsl:variable name="testmap" select="dyn:evaluate('./foo[@type = 'bar']')"/>
There's no standard way to construct an XPath expression from a string at
run-time in either XSLT 1.0 or 2.0.
Some products have an extension to do this, for example saxon:evaluate().
If you want a portable solution, the only way around it is to generate a stylesheet.
Michael Kay
http://www.saxonica.com/
-----Original Message-----
From: Matt Poff [mailto:matt.poff@xxxxxxxxxxxxxxx] Sent: 20 August 2007 06:58
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] Evaluate string as XPATH axis in XSLT1.0?
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}" />
Unfortunately, this results in errors... Any ideas?
Thanks in advance, Matt
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Evaluate string as XPATH , Michael Kay | Thread | Re: [xsl] Evaluate string as XPATH , Florent Georges |
[xsl] "xstlApplyOneTemplate:key was, Melissa Butler | Date | RE: [xsl] Flat XML to hierarchical , christoph . naber |
Month |