Is there any way to amend XML by changing or adding an attribute based on nodes siblings/child value?
I need to transform:
<FieldMatchResult FieldName="Record_Amount">
into one of the following:
<FieldMatchResult FieldName="Record_1_Amount">
or
<FieldMatchResult FieldName="Record_Amount" Tag="Record_1_Amount">
here is my sample and I need to pull out value from "Row Index" element
<?xml version="1.0"?>
<ArtifactMatchResult xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<SubArtifacts>
<ArtifactMatchResult ArtifactName="Data Record">
<Fields>
<FieldMatchResult FieldName="Record_Amount">
<Values>
<anyType xsi:type="xsd:double">123456.5</anyType>
</Values>
</FieldMatchResult>
<FieldMatchResult FieldName="Record_Rate" >
<Values>
<anyType xsi:type="xsd:double">1.25</anyType>
</Values>
</FieldMatchResult>
<FieldMatchResult FieldName="Row Index">
<Values>
<anyType xsi:type="xsd:double">1</anyType>
</Values>
</FieldMatchResult>
</Fields>
<SubArtifacts />
</ArtifactMatchResult>
<ArtifactMatchResult ArtifactName="Data Record">
<Fields>
<FieldMatchResult FieldName="Record_Amount">
<Values>
<anyType xsi:type="xsd:double">123456.5</anyType>
</Values>
</FieldMatchResult>
<FieldMatchResult FieldName="Record_Rate" >
<Values>
<anyType xsi:type="xsd:double">1.25</anyType>
</Values>
</FieldMatchResult>
<FieldMatchResult FieldName="Row Index">
<Values>
<anyType xsi:type="xsd:double">2</anyType>
</Values>
</FieldMatchResult>
</Fields>
<SubArtifacts />
</ArtifactMatchResult>
</SubArtifacts>
</ArtifactMatchResult>
Many thanks for any pointers.