Closed Bktero closed 1 year ago
Looking at the GPX schema (that's all I can find for documentation), there appears to be nothing that forbids an empty string as the link text. That empty xsd:anyURI
href would probably refer to the current document, so it should be okay, too.
I think it might be best to treat <text></text>
as link.text = Some("")
, and when the <text>
element is missing as link.text = None
, as it represents what is in the actual gpx file and allows to re-write the gpx file without changing that part of the file. Or should it be None
in both cases to maybe make life easier for application developers?
There is also an optional <type>
child element of <link>
, which currently has the same issue.
Github didn't notice the PR automatically for some reason. This should be fixed by #93
Hello
A friend sent me a
.gpx
file for a trip that we are planning. I tried to load the file with the following simple code:I got this error:
The metadata section of the
.gpx
file is as follow:The application works properly if I remove
<text></text>
or add some text between the tags. This is coherent with the error, as the tag is empty (it has NoStringContent XD).However, both Komoot and Garmin Connect load the file happily.
I believe the
gpx
library should have a more relaxed behavior when encountering an empty<text>
tag and just ignore the tag, without raising any error.