I need to take an XML file and create a new output file. During creation of the output file, I need to total the quantities by material
This is my input file: -
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<record>
<MATERIAL>Material1</MATERIAL>
<SALES_DIST>FS</SALES_DIST>
<REGION>North</REGION>
<FIELDNM001>EA</FIELDNM001>
<MONTH>2020-01-01</MONTH>
<FIELDNM002>1</FIELDNM002>
</record>
<record>
<MATERIAL>Material1</MATERIAL>
<SALES_DIST>FS</SALES_DIST>
<REGION>North</REGION>
<FIELDNM001>EA</FIELDNM001>
<MONTH>2020-01-01</MONTH>
<FIELDNM002>1</FIELDNM002>
</record>
</data-set>
What I need to end up with is a file like this: -
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<record>
<MATERIAL>Material1</MATERIAL>
<SALES_DIST>FS</SALES_DIST>
<REGION>North</REGION>
<FIELDNM001>EA</FIELDNM001>
<MONTH>2020-01-01</MONTH>
<FIELDNM002>2</FIELDNM002>
</record>
</data-set>
Any ideas on what the xslt document should look like to achieve this?
Many thanks in advance.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<data-set xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<record>
<MATERIAL>Material1</MATERIAL>
<SALES_DIST>FS</SALES_DIST>
<REGION>North</REGION>
<FIELDNM001>EA</FIELDNM001>
<MONTH>2020-01-01</MONTH>
<FIELDNM002>2</FIELDNM002>
</record>
</data-set>