[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] dynamic XPath?


Subject: RE: [xsl] dynamic XPath?
From: Rod Humphris - FLPTN <rod.humphris@xxxxxxxxxxxxxx>
Date: Wed, 12 Mar 2003 15:23:20 -0000

Yue

Looks like the brains on the list have ignored this one so you've got me.

If the question is: 

can you uses xpath to evaluate an reference to a node tree 
	(test="//root/tag1/tag2
against something dynamically generated in or passed to the xslt like 
	$MyVar")
then the answer is no in xlst 1.0 without using a proprietary evaluate()
extension, and it will be no in xslt 2.0 also which I personally think is a
shame. I would like to be able to do Kurts'
<xsl:apply-templates select="$myContext/{$anXPathExpression}"/>
(from thread: A proposal:xsl:result-document asynchronous attribute)

On the other hand if you have a string literal 'actual value' then it's
probably possible to make the comparison you need. What exactly is $tagPath
? a string, a node set? 

Send some more details

cheers

Rod 

-----Original Message-----
From: Yue Ma [mailto:MaY@xxxxxxxxxxxxxxxx]
Sent: 12 March 2003 14:45
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] dynamic XPath?


Hi there,
This could be a dumb question:
Is there a way we can evaluate a dynamic XPath like:
<xsl:if test="$tagPath = 'actual value'">
The tagPath is something like "//root/tag1/tag2"

Seems we can not do it with XSLT 1.0,  right?

Thanks!
Yue



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


________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________


________________________________________________________________
Any opinions expressed in this email are those of the individual and not necessarily the Company. Unless expressly stated to the contrary, this email is not intended to give rise to a new, or affect an existing, contractual or other legal relationship.This email and any files transmitted with it, including replies and forwarded copies which may contain alterations) subsequently transmitted from the Company, are confidential and solely for the use of the intended recipient. The unauthorised use, disclosure or copying of this email, or any other information contained or attached,is prohibited and could, in certain circumstances, be a criminal offence.

If you have received this email in error please notify the sender as soon as possible.

This footnote also confirms that this email message has been swept for the presence of computer viruses.

www.focusdiy.co.uk
_________________________________________________________________

________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________

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



Current Thread
Keywords