Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 如何在XSLT中使用字符映射?_Xml_Xslt - Fatal编程技术网

Xml 如何在XSLT中使用字符映射?

Xml 如何在XSLT中使用字符映射?,xml,xslt,Xml,Xslt,我有以下XSLT样式表: <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:character-map name="cm"> <xsl:output-character character="1" string="abc"/> <xsl:output-charac

我有以下XSLT样式表:

<xsl:stylesheet version="3.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:character-map name="cm">
       <xsl:output-character character="1" string="abc"/>   
       <xsl:output-character character="2" string="def"/>
       <xsl:output-character character="3" string='ghi'/>
    </xsl:character-map>
    <xsl:template match="/">
        123abc
       <abc att="123abc"/>
       <xsl:value-of select="'123abc'"/>
    </xsl:template>
</xsl:stylesheet>

123abc

无论我如何尝试,角色映射似乎都不起作用。有人能告诉我怎么做吗?我遗漏了什么吗?

您已经定义了角色映射,但没有使用它。尝试:


123abc
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:character-map name="cm">
    <xsl:output-character character="1" string="abc"/>   
    <xsl:output-character character="2" string="def"/>
    <xsl:output-character character="3" string='ghi'/>
</xsl:character-map>

<xsl:output use-character-maps="cm" />

<xsl:template match="/">
    123abc
   <abc att="123abc"/>
   <xsl:value-of select="'123abc'"/>
</xsl:template>

</xsl:stylesheet>