Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: does xpath expressions/matches support variables? does xpath expressions/matches support variables?To: NULL Date: 6/3/2006 4:38:00 PM I need to use a variable (similar scenario also for a template parameter) that has been assigned with an xpath string as an xpath expression/match for xsl elements such as xsl:if, xsl:what, xsl:template, etc. 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? 2. Does anyone know of a *clean* design pattern to solve this? Preferably one that i can call as a generic template/function to allow it to called at whim. cheers stoj | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
