georust / gpx

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

Behavior for empty `<name/>` tags #99

Closed jasper-bosch closed 11 months ago

jasper-bosch commented 11 months ago

Hi there,

My GPS tracker app (Sports Tracker) produces gpx files that contain empty name tags:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" xmlns:gpxtpx="http://www.garmin.com/xmlschemas/TrackPointExtension/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" creator="Sports Tracker" version="1.1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd http://www.garmin.com/xmlschemas/TrackPointExtension/v1 http://www.garmin.com/xmlschemas/TrackPointExtensionv1.xsd">
<metadata>
    <name/>
    <desc/>
    <author><name>Jasper</name></author>
</metadata>
<trk>
    <name/>
    <trkseg>
    <trkpt...

That empty name tag in the metadata results in a NoStringContent error.

I created a pull request (#97) that fixes this by allowing the name tag to be empty.

If you need any further information or if you'd like me to add a test then please let me know.

lnicola commented 11 months ago

Fixed in #99.