XSLT 1.0 を使用して、特定のノードの下にあるサブノードを要約しながら、別のノード セットからのデータでコンテンツを洗練された方法で変更するにはどうすればよいでしょうか? 私はこのxmlを持っていると仮定します:
<Root>
<ExchangeRates>
<ExchangeRate>
<CurrencyCode>USD</CurrencyCode>
<Rate>6.4</Rate>
</ExchangeRate>
<ExchangeRate>
<CurrencyCode>EUR</CurrencyCode>
<Rate>8.44</Rate>
</ExchangeRate>
<ExchangeRate>
<CurrencyCode>SEK</CurrencyCode>
<Rate>1</Rate>
</ExchangeRate>
</ExchangeRates>
<Prices>
<Price>
<Currency>SEK</Currency>
<Amount>10000</Amount>
</Price>
<Price>
<Currency>EUR</Currency>
<Amount>1000</Amount>
</Price>
<Price>
<Currency>USD</Currency>
<Amount>1000</Amount>
</Price>
</Prices>
</Root>
ExchangeRates を使用して SEK に変換されたすべての金額の合計が必要です。結果は次のようになります。
<SumInSEK>24840</SumInSEK>
金額を変換する必要がなければ、単純に xpath sum() 関数を使用します。この場合、その機能を使用することは可能ですか?