javascript templates - curly braces in attributes
This is an open discussion with 1 reply, filed under XSLT.
Search
The only solution: output your anchor tag using a text element.
<xsl:choose> <xsl:when test="$js-template = true()"> <xsl:text disable-output-escaping="yes"><a class="some-class" href="{{href}}">{{name}}</a></xsl:text> </xsl:when> <xsl:otherwise> <a class="some-class" href="{$href}"><xsl:value-of select="$name" /></a> </xsl:otherwise> </xsl:choose>
Create an account or sign in to comment.
i've been trying to figure out how to output some javascript templates that have curly braces in my attributes, but it does not happen when output the
innerHTML
of a node. doing something like this (say$js-template
istrue()
):however, the output looks like this:
instead of the desired output:
I tried using the html entity equivalent for left/right curly braces, but the same output was happening.
has anyone experienced any fixes for this?