Is there a way to use just one way of using a variable within XSLT?
For example:
<xsl:variable name="myvar" select="title" />
Which selects the title from my xml, then I would like to use it within the template:
<h2 title="{$myvar}">{$myvar}</h2>
However it only shows the title attribute.
And when I do it like this:
<h2 title="<xsl:value-of select='$myvar'>"><xsl:value-of select='$myvar'></h2>
It only works the other way around.
So my question:
Is there one way that works for both attribute and content?
Yes, you can avoid AVT:
But I think it’s simpler using AVT and
xsl:value-ofproperly: