I am using a variable say xpathvar in the XSLT whose value will be supplied at the time of call to XSLT. How can i achieve this? My XSLT file looks like -
&
If I mention the variable in the for-each, it throws error
In XSLT 1.0 (it looks you are using Xalan), you can iterate over node sets, only. So $xpathvar
should be an instance of node set data type.
In XSLT 2.0 you can iterate over sequence (including scalar values).
Also, if the string containing the "dynamic" XPath expression is simple enough (only QName test step, maybe positional predicates) this could be done (as is already answered in SO) with standar XSLT.