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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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