Hi,
If you want calculate some fields and set result into another xml
element but you don't know that all tag has it. You can use this
XRule.
My XML data :
<Part>
<ID>1</ID>
<FLN ID="F051601001">ÂÓãÇä ÂÈی</FLN>
<FLN ID="F051601002">3400</FLN>
<FLN ID="F051601003">40</FLN>
</Part>
<Part>
<ID>2</ID>
<FLN ID="F051601004">
<CFLN ID="1">10</CFLN>
<CFLN ID="2">2</CFLN>
<CFLN ID="3">4</CFLN>
<Total/>
</FLN>
</Part>
and I wrote this XRule : (Some FLN do't have a Total tag)
<?xml version="1.0" encoding="utf-16"?>
<xr:rules xmlns:xr="http://www.xrules.org/2003/11">
<xr:ruleset context="/Questionnaire/PartList/Part/FLN
[Total='']">
<xr:calculate target="Total">
<xr:value>sum(CFLN)</xr:value>
</xr:calculate>
</xr:ruleset>
</xr:rules>
Best regards
Sasan Nikookar