本当の問題:/root/row/checks[not(taxAmount = sum(selections/tax))]/sum(selections/tax/text())
XPATH:子ノードの合計全体ではなく、XPATH
私は、次のXPATHがあります:
を以下が働いていなかったので、私は2.0の構文でXPATH 1.0を使用していました/root/row/checks[./taxAmount/text() != sum(./selections/tax/text())]/selections/tax/text()
私は、次のような何かをしたい:
/root/row/checks[./taxAmount/text() != sum(./selections/tax/text())]/sum(selections/tax/text())
文全体、つまり/選択肢の下にある子ノードだけを合計したくないのですが、これまでに試した結果、構文エラーが発生します
本質的に、ヘッダーと比較するために詳細を合計したいと考えました。
例XML:ダニエルの答えに基づいて
<root>
<row>
<checks>
<selections>
<tax>1.00</tax>
</selections>
<selections>
<tax>2.00</tax>
</selections>
<selections>
<tax>1.14</tax>
</selections>
<taxAmount>4.14</taxAmount>
</checks>
<checks>
<selections>
<tax>1.00</tax>
</selections>
<selections>
<tax>0.50</tax>
</selections>
<selections>
<tax>1.00</tax>
</selections>
<taxAmount>3.00</taxAmount>
</checks>
<checks>
<selections>
<tax>1.00</tax>
</selections>
<selections>
<tax>0.50</tax>
</selections>
<selections>
<tax>1.25</tax>
</selections>
<taxAmount>5.00</taxAmount>
</checks>
</row>
</root>
編集:
私が探していたものはかなりありません。それは問題にチェックを選択しますが、私はこのような何か欲しかっ:
/ルート/行/チェック[ない(taxAmount = SUM(選択/税込))]/taxAmount /テキスト()
3.00
を5.00
/ルート/行/チェック[しない(taxAmount = SUM(選択/税))]/SUM(選択/税/テキスト())
2.50
2.75
あなたは私達にあなたのXMLドキュメントのサンプルを示してもらえますか? – skovorodkin