I am trying to render markup stored in a variable but I am getting no joy. Reason its cached is because I am using this several times in the page
<xsl:variable name="imgHtml">
<figure>
<img src="{$img}" alt="" class="" />
<figcaption>
<p><xsl:value-of select="name" /></p>
<a href="#">Enlarge Image</a>
</figcaption>
</figure>
</xsl:variable>
I then reference the variable using the value-of elment but for some reason, the HTML does not render. Don’t be shy, I need the help. Thanks!
<xsl:value-of select="$imgHtml" />
Use
<xsl:copy-of select="$imgHtml"/>,value-ofalways creates a plain text node.