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
如何替换'&;amp';与'&';在XML文件中?_Xml_Xslt - Fatal编程技术网

如何替换'&;amp';与'&';在XML文件中?

如何替换'&;amp';与'&';在XML文件中?,xml,xslt,Xml,Xslt,我真的很想替换“&;” 我想改变这个 <Content>The &amp;#x3A9; &amp;lt;product name&amp;gt;</Content> #x3A9&;书信电报;产品名称及名称,;燃气轮机; 到那 <Content>The &#x3A9; &lt;product name&gt;</Content> x3A9;产品名称 有没有办法用replace函数来更

我真的很想替换
“&;”

我想改变这个

<Content>The &amp;#x3A9; &amp;lt;product name&amp;gt;</Content>
#x3A9&;书信电报;产品名称及名称,;燃气轮机;
到那

<Content>The &#x3A9; &lt;product name&gt;</Content>
x3A9;产品名称
有没有办法用replace函数来更改它?如果没有,还有其他选择吗

谢谢


<xsl:template match="Content">
    <xsl:copy>
        <xsl:value-of select="." disable-output-escaping="yes"/>
    </xsl:copy>
</xsl:template>
结果:

<Content>The &#x3A9; &lt;product name&gt;</Content>
x3A9;产品名称

在文本编辑器中?以编程方式?是否确定所有双转义引用都是字符引用或内置XML实体(lt、gt、amp、quot或apos)?如果您有其他实体,比如HTML实体(
&;eacute;
),那么天真的方法将导致输出不是格式良好的XML。