こんにちは、saxon でも eclipse を使用してこの xml データを変換しようとしていますが、saxon xslt2.0 で変換しようとすると、メモリ エラーが発生します。デフォルトの eclipse xslt 変換で実行すると、変更は 500M です。出力はエラーなしで実行され、ノードと 1 つの URL が正しく変更されたが、ノードではなく、他のデータがない xml が返されます。
これはxslファイルです:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<xsl:variable name="replacedURL">
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="/products/product/buy_link/text()"/>
<xsl:with-param name="replace" select="'[[PARTNERID]]'"/>
<xsl:with-param name="by" select="'12345'"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$replacedURL"/>
</xsl:template>
<xsl:template name="string-replace-all">
<xsl:param name="text"/>
<xsl:param name="replace"/>
<xsl:param name="by"/>
<xsl:choose>
<xsl:when test="contains($text, $replace)">
<xsl:value-of select="substring-before($text,$replace)"/>
<xsl:value-of select="$by"/>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="substring-after($text,$replace)"/>
<xsl:with-param name="replace" select="$replace"/>
<xsl:with-param name="by" select="$by"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>