をトラブル:(XSLT再帰合計が、私は、再帰的な合計に複数のノードからの属性をしようとすると、それは文字列のように糊付けだ
XMLファイル(第2走行距離-ノードは、最初の走行距離・ノードが含まれる)
<mileage value="15000">
<operation title="Replacing the engine oil" cost="500" />
<sparepart title="Oil filter" cost="250" />
<sparepart title="Motor oil" cost="1050" />
</mileage>
<mileage value="30000">
<repeating mileage="15000" />
<operation title="Replacement of spark" cost="1200" />
</mileage>
XSL-テンプレート
<xsl:template match="mileage[@value]">
<xsl:param name="sum" select="number(0)" />
<xsl:variable name="milinkage"><xsl:value-of select="number(repeating/@mileage)" /></xsl:variable>
<xsl:apply-templates select="parent::*/mileage[@value=$milinkage]"><xsl:with-param name="sum" select="number($sum)" /></xsl:apply-templates>
<xsl:value-of select="number(sum(.//@cost))"/> <!-- + number($sum) -->
</xsl:template>
集成結果は18001200ですが、私は ここで間違っているものを私に教えてください3000(+ 1200 1800)を参照してくださいしたいですか?
Thanx!
申し訳ありませんが、それは私の最初のポストstackoverflowです。 – Yuri
私は自分の答えを編集しました。これがあなたの問題を解決することを願っています。 – therealmarv