【发布时间】:2013-02-08 07:08:52
【问题描述】:
我有 xml 。我使用以下 XPath 表达式:
sum(//Item[@type='sg_aml_rel'][(./sg_percentage * ./related_id/Item[@type='sg_aml2']/sg_cost)])
我创建了 XMLDoucment 对象并将 XML 加载到其中,然后创建了 XPathNavigator 对象并提供 xpth 来评估 XPathNavigator 的方法。 我的 XML 看起来像:
<AML>
<Item>
<sg_percentage>10</sg_percentage>
<related_id>
<Item>
<sg_cost>100<sg_cost>
</Item>
<related_id>
</Item>
<Item>
<sg_percentage>20</sg_percentage>
<related_id>
<Item>
<sg_cost>500<sg_cost>
</Item>
<related_id>
</Item>
<AML>
我想要 SUM(sg_percentage*sg_cost)。
【问题讨论】:
-
@DanielHaley:那个副本没有任何价值——它作为 NARQ 被关闭,并且有 7 个反对票。
-
@JonEgerton - 你是对的。我一定是粘贴了错误的 URL。该用户已发布此问题 4 次。