Hello there everyone. I'm quite new to c++ and I was wondering if I could get your help with how to go about starting some code.
What I have is an xml file that is full of data in this structure:
what I need to go about doing is write some code that can identify how many nodes there are in the file and store their respective IDs, latitude, and longitude.
I haven't the slightest clue as to how I can go about collecting this data.... so any help is appreciated!
libxml++ aparrently parses data in an xml file, so you might want to look into that (i havent used it though so idk.)
what i would do is read in each character from the file, and then if you hit < you know you are in a tag (xml calls them tags like html right?) then just read until the last > (careful to makesure you arent reading one in a quote). then sort it into fiels by whitespace, and you should be able to get a list of all of the nodes
edit: if you havent figured anything out by tonite ill show you an example of what i mean
I'm much more comfortable in python, in which case I'd make a list of lists to separate the whole text into lines and then those lines into words. Then just check for where the list[i][0] == "<node" to count how many nodes there are and then sort data that way. I have no clue if that is the correct way to go about it in c++ or if there is an easier way.