Open tsteven4 opened 10 months ago
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).
$ 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.$ 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.