tags:

views:

149

answers:

2

Hello guys,

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

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

This has really got me stumped.

Thanks guys.

A: 

You can't as is. The {name} shortcut doesn't allow additional parameters. Use the <xsl:attribute> tag instead.

gizmo
+2  A: 

This cannot be done with XSLT. The spec says:

It is an error for output escaping to be disabled for a text node that is used for something other than a text node in the result tree.

Thus it makes no difference if you use Attribute Value Templates or xsl:attribute with xsl:value-of, because you're generating an attribute node, not a text node. It's a limitation in the language.

jelovirt
You are right, I deleted my incorrect answer, +1
0xA3
you learn something every day :) +1
Chad Scira