Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

$param name in div

Tags:

xml

xslt

I have A $param that I am passing into a template. I wish to use the value of this parameter as class name for a div. The class is not taking the value of the parameter but taking the parameter name (in the html page it is $param). Is there any way I can use the value of a parameter as a class name?


1 Answers

To use a XSLT expression in an attribute of a literal result element, surround the expression with braces like so:

<div class="{$param}"> ... </div>

This is known as an attribute value template.

like image 135
Inshallah Avatar answered Jan 26 '26 18:01

Inshallah



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!