I find difficulty in converting string to xpath in xslt
XSLT
<xsl:param name="name"/>
<xsl:template match="/">
<xsl:if test="$name">
<xsl:message><xsl:value-of select="$name"/></xsl:message>
<xsl:value-of select="$name"/>
</xsl:if>
</xsl:template>
param ‘name’ value (Xpath expression) will be passed from java. What should i do in xsl to consider this string as xpath?
What you’re asking for is something akin to the
evalfunction of languages such as Perl, to treat a string as an expression in the language. This is not something that XSLT 1.0 or 2.0 provides natively, though many processors provide support through extension functions such as EXSLT. The current XSLT 3.0 working draft provides a similar mechanism, which is supported by Saxon.