Hi all.
I'm trying to read an XML file with QXmlStreamReader. To be more specific, I'm reading in a kml file. Everything has been working great so far. I can read the elements and their data. Problem is that I have one element like this:
<coordinates> 122.0848938459612,37.42257124044786,17
122.0849580979198,37.42211922626856,17
122.0847469573047,37.42207183952619,17
122.0845725380962,37.42209006729676,17 </coordinates>
<coordinates> 122.0848938459612,37.42257124044786,17
122.0849580979198,37.42211922626856,17
122.0847469573047,37.42207183952619,17
122.0845725380962,37.42209006729676,17 </coordinates>
To copy to clipboard, switch view to plain text mode
When I read the element data with reader.text() I have no newline in the data, giving me a string like this:
122.0848938459612,37.42257124044786,17122.0849580979198,37.42211922626856,17122.0847469573047,37.42207183952619,17122.0845725380962,37.42209006729676,17
122.0848938459612,37.42257124044786,17122.0849580979198,37.42211922626856,17122.0847469573047,37.42207183952619,17122.0845725380962,37.42209006729676,17
To copy to clipboard, switch view to plain text mode
As you can see, with out any delimiter between the different lines. And without any delimiter, there is no way to parse the data (e.g. using some kind of split function).
Why would QXmlStreamReader not insert newlines in the data? How can we parse or handle this differently?
Edit: for your information, I tried the kml parsing using DOM, but received the same results.
Bookmarks