XSLT转义撇号和引号

时间:2018-04-11 12:29:58

标签: xslt escaping quotes apostrophe

我有一个类似的文本这是XSLT中“转义”的“示例” 我想替换“with”和“with”。 所以输出应该是 这是“逃避”的“例子”。 我如何创建递归模板。 请帮忙。谢谢。

1 个答案:

答案 0 :(得分:0)

XSLT 2.0 中添加文字模板

<xsl:template match="text()">
    <xsl:value-of select="replace(., '(&quot;|'')', '\\$1')"/>
</xsl:template>

<强>输出

This is an \"example\" of \'escaping\'
相关问题