XSLT – Using XSL Variable inside <a href>

Recently i am working on XSLT.

i got an xsl_variable which can be retrieved by <xsl:value-of select=”./xsl_variable” /> in the .xsl. i would like to pass this variable to a Javascript function called popup() inside the <a href>.

Here is my code in the .xsl

<a><xsl:attribute name="href">javascript: popup("<xsl:value-of select="./xsl_variable" />")</xsl:attribute>
	<xsl:value-of select="./xsl_variable" />
</a>

Done =)

Reference: How to <a href = “XSLT var”> ?

4 thoughts on “XSLT – Using XSL Variable inside <a href>”

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.