I have an XML file that has the data for multiple pictures such as GPS coordinates, date/time, and some image data that I need to split into several XML files.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.1">
<Document>
<Placemark>
<name> //picture 1 info <name>
<Point>
<coordinates> //gps 1 cords <coordinates>
<Point>
<Placemark>
<Placemark>
<name> //picture 2 info <name>
<Point>
<coordinates> //gps 2 cords <coordinates>
<Point>
<Placemark>
<Document>
I want it to look something like this:
File 1:
<Placemark>
<Name> //picture 1 info <name>
<Point>
<coordinates> //gps 1 cords <coordinates>
<Point>
<Placemark>
File 2:
<Placemark>
<Name> //picture 2 info <name>
<Point>
<coordinates> //gps 2 cords <coordinates>
<Point>
<Placemark>
…..I read this question:
Split XML in Multiple XML files
and tried to modify the code a little bit for my file after importing everything. Wondering if anyone had any good ideas on how to modify my code to do the spit like in the question above.
Here is the basic structure you could use if programming on the Android. This would open an xml file from a web address (R.string.XmlUrlAddress). It would then parse the string and write to another file, probably stored on your Android device?
The commented areas are code that I didn’t write rather than comments on what the code is doing. I didn’t want to take the time to look up the file io code which should be pretty straight forward.