From: Tim <ti...@st...> - 2003-10-29 12:07:43
|
This is a little hard to explain but i will try, after the responses from my previous email i switched to using the DomParser . ok just until i get this all right i am just using the domparser example(libxml++/examples/dom_parser). i am using this very tiny cut down xml file (see below) ok in the int main() part in main.cc i would like to be able get the data out of 1 certain node-element for eg the value of "DOWNLOADS" out of "normal billable traffic". I need to be able to minus that amount from the "MEAGABYTES" amount to get the usage remaing for the month and been able to pull the data out one by one instead of just printing it all in order like print_node(pNode) does, i can see how handy in some cases it is to just print it all out as it lies in the XML file but for my case i need to re-arrange things and also store things in "stings" "int" etc etc for later use, such as what i mentioned above. Another example...the last part of the xml file the PLAN DESCRIPTION, that would print last using the print_node call, really something like that i would prefer to print first along with START_DATE, END_DATE. Does any of this make sense??. I don't know why my ISP does the XML feed in that order but there is nothing i can do about that, actually sometimes they change the order of things too but never do they change the node names. Thanks again guys Tim ***************** xml file ************************ <USAGE START_DATE="21-10-2003" GRANULARITY="MONTH" VERSION="3" END_DATE="20-11-2003"> <TRAFFIC DESCRIPTION="Normal Billable Traffic"> <DATA UPLOADS="0" DOWNLOADS="316" TYPE="Standard" TIMESTAMP="2003-10-21 00:00:00" /> </TRAFFIC> <TRAFFIC DESCRIPTION="Free Traffic"> <DATA UPLOADS="0" DOWNLOADS="3" TYPE="Standard" TIMESTAMP="2003-10-21 00:00:00" /> </TRAFFIC> <PLAN DESCRIPTION="Home 512 Flat Rate"> <LIMIT NAME="Standard" MEGABYTES="6000" /> </PLAN> </USAGE> ********************************************************************** |