comment-escape-string.recursive

comment-escape-string.recursive — Internal function used by comment-escape-string

Description

The comment-escape-string.recursive template is used by comment-escape-string.

<xsl:template name="comment-escape-string.recursive">
  <xsl:param name="string" select="''"></xsl:param>
  <xsl:choose>
    <xsl:when test="contains($string, '--')">
      <xsl:value-of select="substring-before($string, '--')"></xsl:value-of>
      <xsl:value-of select="'- -'"></xsl:value-of>
      <xsl:call-template name="comment-escape-string.recursive">
        <xsl:with-param name="string" select="substring-after($string, '--')"></xsl:with-param>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$string"></xsl:value-of>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>