Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML Question

Status
Not open for further replies.

jgos

Programmer
Sep 27, 2002
38
0
0
US
Is there a function in the XML library that will allow you to sum all of a certain type of fields in an XML Package?
 
I am pretty sure that there isn't. The only way I can think of doing soemthing like that is to loop through the elements and add them that way, however, it depends on how your xml file is set up.
 
If you are using DOM just do a for each loop on the type of node and run your own sum.

If you are using SAX just increment a variable every time you hit the element you want.

You must roll your own function to repeat above but it should not be too hard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top