问题
I have a xsl 2.0 stylsheet which uses xsl 2.0 specific enhancements. I am now trying to move templates in xsl 1.0 as I have some restrictions in using xsl2.0. When I am running my xsl 1.0 templates I am getting some encoding related errors. I wanted to understand what is the equivalent of use-character-maps in xsl 1.0.
Thanks
回答1:
Character maps are a new feature in XSLT 2.0, there is no equivalent feature in XSLT 1.0. However if you want to output a certain entity or character reference in XSLT 1.0 then disable-output-escaping
as in e.g.
<xsl:text disable-output-escaping="yes"><![CDATA[ ]]></xsl:text>
might suffice, as long as the transformation result is serialized. In fact, disable-output-escaping use is a feature in XSLT 1.0 supposed to be replaced by character map use in XSLT 2.0.
回答2:
If you are getting "encoding related errors" then it might be worth finding and eliminating the root cause of those errors, rather than trying patch around them with character maps or disable-output-escaping.
来源:https://stackoverflow.com/questions/20883116/xsl-use-character-maps-eqivalent-in-xsl-1-0