XSLT Query for Escaping Characters

Let's say I have the following code snippet, how do I also apply disable-output-escaping to the {name} in the title attribute?

<a title="{name}"><xsl:value-of select="name" disable-output-escaping="yes" /></a>

      

This really puzzled me.

Thanks guys.

+1


a source to share


2 answers


This cannot be done with XSLT. spec says :

It is a bug to exit disable for text node which is used for anything other than text node in the result tree.



So it doesn't matter if you are using attribute value templates or xsl:attribute

with xsl:value-of

, because you are generating a node attribute, not a text node. This is a limitation in language.

+3


a source


You cannot as it is. The {name} shortcut does not allow adding additional parameters. Use the <xsl:> attribute instead.



0


a source







All Articles