请注意,我是 XSLT 的新手,可能永远不必再次使用它。
我有一个简化的 XML 文档,如下所示:
<row>
<tax_allocation_details>
<tax_allocation_detail>
<allocation_percent>0.0269</allocation_percent>
</tax_allocation_detail>
<tax_allocation_detail>
<allocation_percent>0.0583</allocation_percent>
</tax_allocation_detail>
<tax_allocation_detail>
<allocation_percent>0.1704</allocation_percent>
</tax_allocation_detail>
<tax_allocation_detail>
<allocation_percent>0.7444</allocation_percent>
</tax_allocation_detail>
</tax_allocation_details>
<ParticipantID>364787525</ParticipantID>
<TransactionAmount>407252.34</TransactionAmount>
</row>
我想要做的是输出所有分配百分比 * TransactionAmount 产品的总和,并且对如何做到这一点一无所知。我正在使用 XSLT 2.0 并进行了一些研究并发现
sum(for $x in node-set return f($x))
可以使用,但我完全不知道如何实现它,也没有时间去理解它。