I am needing to get percentages from an xml file into another xml file.
Here is a snippet of the in file(there will be hundreds of the <pavement_x0020_Conditions> nodes in the real file):
Code:
<dataroot>
<pavement_x0020_Conditions>
<NetworkID>MONROE</NetworkID>
<Name>FIRSTAIR FIELD</Name>
<BranchID>T03MN</BranchID>
<SectionID>01</SectionID>
<Surface>AC</Surface>
<Area>25865</Area>
<Condition>100</Condition>
<DATE>2005-03-01T00:00:00</DATE>
<SAMPLES>0</SAMPLES>
</pavement_x0020_Conditions>
and here is a snippet of how I need it to look:
Code:
<record>
<Type>AC</Type>
<Area>59,289,768</Area>
<Percentage>49%</Percentage>
</record>
<record>
<Type>PCC</Type>
<Area>33,794,172</Area>
<Percentage>28%</Percentage>
</record>
Basically I need to know how to pull all the areas for all types (e.g., AC, PCC) add them, and figure a percentage for each. I actually know how to pull each type's area and add it with the Sum() function (I think), it's the percentage that I am having trouble with.
Thanks in advance.