字符映射不起作用

时间:2016-06-03 14:00:46

标签: c# xml xslt-2.0

我在代码中使用XSLT 2.0的字符映射功能时遇到错误。

元素'样式表'在命名空间' http://www.w3.org/1999/XSL/Transform'具有无效的子元素' character-map'在命名空间' http://www.w3.org/1999/XSL/Transform'

这是我的XSLT声明

<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:character-map name="a">
        <xsl:output-character character="'" string="&amp;apos;"/>

</xsl:character-map>
  <xsl:output indent="yes" use-character-maps="a"/>

请帮助我们了解如何在XSLT中使用字符映射。

1 个答案:

答案 0 :(得分:0)

正如评论中所提到的,您的问题的答案是您需要使用XSLT 2.0处理器,因为您的样式表使用XSLT 2.0构造。 .NET中的Microsoft处理器是XSLT 1.0处理器。各种第三方XSLT 2.0处理器可用于.NET平台。