≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
Processing EXN_TEXT
Posted by:
(you are not logged in)
Enter the missing letter in: "Internat?onal"
(you are not logged in)
Text:
[quote][b]Willem[/b] wrote: I am trying to get GPS data out of a GPX file: The problem is the elevation <ele>value</ele>, which is EXN_TEXT. Here is a part of the .xml file: [code] <trkpt lat="-41.337876" lon="174.790258"> <ele>102.04</ele> <time>2009-12-13T23:57:13Z</time> <extensions> <gpxtpx:TrackPointExtension> <gpxtpx:atemp>10.4</gpxtpx:atemp> </gpxtpx:TrackPointExtension> </extensions> </trkpt> [/code] Any ideas, this works, but is ugly: [code] unsigned char processNext = 0; std::string lat, lon, ele; IrrXMLReader* xml = createIrrXMLReader("data/adelaide.gpx"); while (xml && xml->read()) { std::string e = xml->getNodeName(); if (!strcmp("ele", e.c_str())) { processNext++; } switch (xml->getNodeType()) { case EXN_NONE: break; case EXN_COMMENT: break; case EXN_ELEMENT_END: break; case EXN_UNKNOWN: break; case EXN_CDATA: break; case EXN_ELEMENT: if (!strcmp("trkpt", xml->getNodeName())) { lat = xml->getAttributeValue("lat"); lon = xml->getAttributeValue("lon"); printf("%s,%s,", lat.c_str(), lon.c_str()); } break; case EXN_TEXT: // The next element should be <ele> if (processNext == 1) { ele = xml->getNodeData(); printf("%s\n", ele.c_str()); } else if (processNext == 2) { processNext = 0; } break; } } delete xml; [/code] I would like to do something on the <ele>value</ele> node but don't know what else to do. Any suggestions would be appreciated. Thanks, Willem[code]source code[/code][/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact