Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - does xpath expressions/matches support variables? [Thread Next] Re: does xpath expressions/matches support variables?To: NULL Date: 6/4/2006 1:54:00 PM stoj wrote: > Eg. xsl snippet - intended to invoke execute-code block if the node exists. > It works perfectly if i replace "$var" with "/root/parent/child". > > <xsl:variable name="var">/root/parent/child</xsl:variable> > <xsl:if test="$var"> > ...execute-code > </xsl:if> > > 1. Observed behaviour is that the if statement always fires. Presumably > because it is resolving to <xsl:if test="'/root/parent/child'">, which > resolves to true. If this is true, how can i change this to <xsl:if > test="/root/parent/child">? Is there a function availble to strip away the > extra quotations? Some processors have extension functions for dynamic evaluation of a string as an XPath expression but usually within XSLT 1.0 there is no way to dynamically evaluate a string as an XPath expression. -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
