Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpx writer can violate schema when extensions exist, gpx read and write versions differ, and passthrough is used. #1194

Open
tsteven4 opened this issue Oct 23, 2023 · 1 comment

Comments

@tsteven4
Copy link
Collaborator

  1. reading 1.0, writing 1.1.
    gpsbabel -i gpx -f reference/gc/GCGCA8.gpx -o gpx,gpxver=1.1 -F gc11.gpx
    $ xmllint --noout --schema tools/schema/gpx/topografix/gpx11.xsd gc11.gpx gc11.gpx:20: element cache: Schemas validity error : Element '{http://www.groundspeak.com/cache/1/0}cache': This element is not expected. Expected is one of ( {http://www.topografix.com/GPX/1/1}fix, {http://www.topografix.com/GPX/1/1}sat, {http://www.topografix.com/GPX/1/1}hdop, {http://www.topografix.com/GPX/1/1}vdop, {http://www.topografix.com/GPX/1/1}pdop, {http://www.topografix.com/GPX/1/1}ageofdgpsdata, {http://www.topografix.com/GPX/1/1}dgpsid, {http://www.topografix.com/GPX/1/1}extensions ). gc11.gpx fails to validate
    element groundspeak:cache is written as a child of wpt, not as a child of extensions.
  2. reading 1.1, writing 1.0
    gpsbabel -i gpx -f reference/basecamp.gpx -o gpx,gpxver=1.0 -F bc10.gpx
    $ xmllint --noout --schema tools/schema/gpx/topografix/gpx10.xsd bc10.gpx bc10.gpx:27: element extensions: Schemas validity error : Element '{http://www.topografix.com/GPX/1/0}extensions': This element is not expected. Expected is one of ( {http://www.topografix.com/GPX/1/0}type, {http://www.topografix.com/GPX/1/0}fix, {http://www.topografix.com/GPX/1/0}sat, {http://www.topografix.com/GPX/1/0}hdop, {http://www.topografix.com/GPX/1/0}vdop, {http://www.topografix.com/GPX/1/0}pdop, {http://www.topografix.com/GPX/1/0}ageofdgpsdata, {http://www.topografix.com/GPX/1/0}dgpsid, ##other{http://www.topografix.com/GPX/1/0}* ). bc10.gpx:41: element extensions: Schemas validity error : Element '{http://www.topografix.com/GPX/1/0}extensions': This element is not expected. Expected is one of ( {http://www.topografix.com/GPX/1/0}type, {http://www.topografix.com/GPX/1/0}fix, {http://www.topografix.com/GPX/1/0}sat, {http://www.topografix.com/GPX/1/0}hdop, {http://www.topografix.com/GPX/1/0}vdop, {http://www.topografix.com/GPX/1/0}pdop, {http://www.topografix.com/GPX/1/0}ageofdgpsdata, {http://www.topografix.com/GPX/1/0}dgpsid, ##other{http://www.topografix.com/GPX/1/0}* ). bc10.gpx fails to validate
    The extensions element doesn't exist in 1.0.
@tsteven4
Copy link
Collaborator Author

A possible solution is to split kFsGpx into version dependent types, one for gpx 1.0, one for gpx 1.1. Then have the gpx writer only search for the data that was read from the same version we are writing, dropping any cross version data. gpx_namespace_attributes may need to be split as well (or replaced with version dependent gpx_namespaces).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant