Image of XSLT 2.0 and XPath 2.0 Programmer's Reference (Programmer to Programmer)
Image of Advanced Programming in the UNIX Environment, Second Edition (Addison-Wesley Professional Computing Series)
Image of Android Wireless Application Development
Image of Modern Operating Systems (3rd Edition)

XSLT Dynamic Path Evaluation

One of the problems that beginning users of the XSLT language who come from more traditional languages such as C may encounter is the question of how to evaluate an XPath expression that is build up from one or more strings such as in the following simple example: <xsl:variable name="xPath:">/root/first</xsl:variable> <xsl:variable name="xNodeSet"> <xsl:copy-of select=’$xPath’ /> </xsl:variable> To the surprise of all who encounter this issue for the first time, xPath will be evaluated as a string, rather than as a node-set and the variable XNodeSet is set to the string /root/first. This is because the Xpath expression is dynamic rather