XSLT: Disable output escaping in an entire document.
- by Kragen
I'm trying to generate some C# code using xslt - its working great until I get to generics and need to output some text like this:
MyClass<Type>
In this case I've found that the only way to emit this is to do the following:
MyClass<xsl:text disable-output-escaping="yes"><</xsl:text>Type<xsl:text disable-output-escaping="yes">></xsl:text>
Where:
Often it all needs to go on one line, otherwise you end up with line breaks in the generated code
In the above example I technically could have used only 1 <xsl:text />, however usually the type Type is given by some other template, e.g:
<xsl:value-of select="@type" />
I don't mind having to write < a lot, but I would like to avoid writing <xsl:text disable-output-escaping="yes"><</xsl:text> for just a single character!
Is there any way of doing disable-output-escaping="yes" for the entire document?