dcsimg
inserting a variable into an XPath
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Dean_McQuiston
Posted On:   Wednesday, March 24, 2004 10:22 AM

This is similar to my last posting, but more focussed. I want to be able to declare an xsl variable, and then insert its value into an XPath expression. something like this, but it never works and I suspect the variable is being converted to a string, and what is expected by XPath is a nodeset. I have tried converting to a node-set first to get around this, but it doesn't work. I know I could use another language to do this, but I need to do it with XSLT for project-specific reasons. Is there any way to assign a value to a variable, and then embed that variable within an XPath or other expression? thanks    More>>

This is similar to my last posting, but more focussed. I want to be able to declare an xsl variable, and then insert its value into an XPath expression.







something like this, but it never works and I suspect the variable is being converted to a string, and what is expected by XPath is a nodeset. I have tried converting to a node-set first to get around this, but it doesn't work.


I know I could use another language to do this, but I need to do it with XSLT for project-specific reasons.


Is there any way to assign a value to a variable, and then embed that variable within an XPath or other expression?


thanks

   <<Less

Re: inserting a variable into an XPath

Posted By:   Finnbarr_Murphy  
Posted On:   Monday, March 29, 2004 05:52 PM

bad news unfortunately - there is no way in XSLT1 to construct XPath expressions at runtime using variables.
About | Sitemap | Contact