당신은 XSLT 1.0에서 재귀를 사용할 수 있습니다 :
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="/">
<xsl:variable name="apos">'</xsl:variable>
<xsl:variable name="test">&rsquo;</xsl:variable>
<xsl:variable name="input">'sfdds'</xsl:variable>
<xsl:variable name="result">
<xsl:call-template name="replace">
<xsl:with-param name="input" select="$input"/>
<xsl:with-param name="value" select="$apos"/>
<xsl:with-param name="replacement" select="$test"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$result" disable-output-escaping="yes"/>
</xsl:template>
<xsl:template name="replace">
<xsl:param name="input"/>
<xsl:param name="value"/>
<xsl:param name="replacement"/>
<xsl:choose>
<xsl:when test="contains($input, $value)">
<xsl:value-of select="substring-before($input, $value)"/>
<xsl:value-of select="$replacement"/>
<xsl:call-template name="replace">
<xsl:with-param name="input" select="substring-after($input, $value)"/>
<xsl:with-param name="value" select="$value"/>
<xsl:with-param name="replacement" select="$replacement"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$input"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
출력 :
’sfdds’
,
@downvoter, 관심 케어? –
이렇게 해보았을 때 클라이언트 측의 html은'’' – Cruncher