How to use xsl:value-of select inside html tags as an attribute using xsl:attribute

If you want to use <xsl:value-of select=””/> inside .xsl files.

Use the following examples;

The following is used as an attribute for html tags;

<a><xsl:attribute name=”href”><xsl:value-of select=”bnk:URL”/></xsl:attribute> Click me </a>

the result will be such as the following

or the second solutions is using XPath expression inside {} braces such as

<a href={bnk:URL}>Click me</a>

and the result will be same;

<xsl:value-of select> could be also used like;

<td> <xsl:value-of select=”bnk:URL”/ ></td>

the result is;



Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s