Image of Android Wireless Application Development
Image of RHCE Red Hat Certified Engineer Linux Study Guide (Exam RH302) (Certification Press)
Image of Beginning Google Maps API 3
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