apply-templatesを使用してwith-paramを使用することは不可能です。例として、私はw3schoolsで与えられた例をハッキングしました。XSLでapply-templatesを使用するためのパラメータを取得できないのはなぜですか?
XSL
<xsl:template match="/">
<xsl:apply-templates>
<xsl:with-param name="test" select="'has this parameter been passed?'"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="cd">
<xsl:param name="test"></xsl:param>
parameter:
<xsl:value-of select="$test"></xsl:value-of>
</xsl:template>
XML
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
</catalog>
(うまくいけば)あなたがテストパラメータは、CDのテンプレートに渡されていないことがわかります。私はcall-templateを使用するときには動作させることができますが、apply-templatesは使用できません。どうしたの?私はXSL 1.0を使用しています。ハードコーディングされたパラメータを渡しているという事実を無視してください。これは単なる例です。
はい - それは動作しますが、なぜ元のサンプルが動作しないのですか? – Goran
ああ。しかし、なぜパラメータがcdに渡されないのでしょうか?ここには – darasd
カタログがありますので、元の例が有効です。そして、それはlibXSLTとOperaで行います。 – vartec