Page 1 of 1

XMLWrite task - adding two values

Posted: Thu Apr 16, 2015 10:10 am
by gaurav26
Hello,

I am writing a project and in which I am reading an excel file and creating an xml using XMLWrite task as part of it.
For one of the elements, we need to add two values for the record in the RowSet and I am not able to achieve it using the + operator. Can you please let me know how it needs to be done. Also, either or both of the values can be blank in the source rowSet.

I am using the below code to do that.

<element name="SUISDITaxAmount" value="${transData['Local 1 Tax Paid']} + ${transData['Local 2 Tax Paid']}" skipIfEmpty="true" type="DECIMAL" trim="both" />

Re: XMLWrite task - adding two values

Posted: Fri Apr 24, 2015 12:21 pm
by Support_Rick
Gaurav26,

Try utilizing the "ModifyRowset" task.

There is a Tips and Tricks Article that I put out back in June, 2014 about how to use this Task.

Just read your Excel Spreadsheet to create your rowset variable.
Modify the Rowset variable to add the values together creating the finalize rowset you desire.
Then, write out the rowset vars to your XML.

This should get you to where you're needing.