xsl use-character-maps eqivalent in xsl 1.0

白昼怎懂夜的黑 提交于 2019-12-25 02:28:29

问题


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[&nbsp;]]></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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!