georust / gpx

Rust read/write support for GPS Exchange Format (GPX)
https://crates.io/crates/gpx
MIT License
102 stars 46 forks source link

Return content of extensions tag as XML to the user #11

Closed Lingepumpe closed 5 years ago

Lingepumpe commented 6 years ago

A solution to Issue #8, gives Waypoint a new field called "extension_xml", which contains the XML String that was contained in the extensions Tag, if present. The user will need to parse this String according to his needs.

Lingepumpe commented 6 years ago

This is only for waypoints, I saw the gpx spec allows the extensions element at many more places. If my approach here to provide the xml contained in the extensions tag is deemed a good approach, then I can apply the same logic to all the places the gpx spec allows extensions.

So give me some feedback please!

brendanashworth commented 6 years ago

@Lingepumpe I'm not sure about this, it seems almost like a cop-out to me. If I was importing a library to parse my GPX file, I wouldn't want to import my own XML parser for a single extension I wanted to read. I'd expect the library to do it for me out of the box.

However that might not be possible/easy with Rust.. do you have any thoughts on that?

frewsxcv commented 6 years ago

i agree with you @brendanashworth, i think we can provide a better user experience for this here than "here's an XML string, you're on your own!". what would be ideal here? returning an XML tree for extension elements?

brendanashworth commented 5 years ago

I'm going to go ahead and close this for lack of forward momentum, but this is generally something I'd like to see in rust-gpx in the future.