... the user friendly GPS tool


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Invalid xmlns:gpxx attribute
#1
I've had trouble uploading GPX files to the RunKeeper app.

it appears that RouteConverter is inserting an invalid URL in the xmlns:gpxx attribute of the gpx tag:

The track was created by my Foretrex 301.
I opened it in RouteConverter and a) deleted a spurious track and b0 deleted spurious trackpoints from the remaining track.
I then saved the file.
Although RunKeeper was happy with the original file is said the revised file was invalid. Both files test OK with SAXCount.

After a bit of poking about in the two files I noticed that the original text in the xmlns:gpxx attribute, "http://www.garmin.com/xmlschemas/GpxExtensions/v3" had been replaced by "http://www.garmin.com/xmlschemas/WaypointExtension/v1"

This seems to be incorrect as the gpxx attribute should (as far as I can see) point to the overall schema extensions directory, not an individual extension schema.

Reverting the text of this attribute to the original fixes the problem.

The file exported by the Foretrex and the file exported by RouteConverter are attached.


Attached Files
.gpx   Current_20150617_original.gpx (Size: 48.15 KB / Downloads: 790)
.gpx   Current_20150617_rteconv.gpx (Size: 94.66 KB / Downloads: 742)
Reply
#2
(19.06.2015, 18:26)shetland_breeder Wrote: I've had trouble uploading GPX files to the RunKeeper app.

That's http://runkeeper.com/ ?

(19.06.2015, 18:26)shetland_breeder Wrote: it appears that RouteConverter is inserting an invalid URL in the xmlns:gpxx attribute of the gpx tag:

To be precise, the line
Code:
xmlns:gpxx="http://www.garmin.com/xmlschemas/WaypointExtension/v1"
defines a namespace (which is an URL in this case but it might be anything) with the ID http://www.garmin.com/xmlschemas/WaypointExtension/v1 and binds it to the prefix gpxx

Thus, when a XML parser finds an element or attribute prefixed with gpxx like <gpxx:abc> it knows that is different than <xyz:abc>

It's perfectly valid in XML to bind a namespace to an arbitrary prefix.

So RouteConverter is doing nothing wrong or false. http://runkeeper.com/ seems to be the problem.

(19.06.2015, 18:26)shetland_breeder Wrote: After a bit of poking about in the two files I noticed that the original text in the xmlns:gpxx attribute, "http://www.garmin.com/xmlschemas/GpxExtensions/v3" had been replaced by "http://www.garmin.com/xmlschemas/WaypointExtension/v1"

This seems to be incorrect as the gpxx attribute should (as far as I can see) point to the overall schema extensions directory, not an individual extension schema.


No, changing the namespaces just because http://runkeeper.com/ insists that gpxx is the prefix for http://www.garmin.com/xmlschemas/GpxExtensions/v3 is just the last resort. It might break other services and apps which typically takes months until the feedback comes back to me.

(19.06.2015, 18:26)shetland_breeder Wrote: Reverting the text of this attribute to the original fixes the problem.

... points you to http://runkeeper.com/ which seems to make assumptions about the structure of the imported files. Please point them to the problems that you have with their service. It should be easy for them to fix their import. Funnily, the prefix isn't used in both files but at least on RouteConverter's side couldn't convince the Java XML parser to leave it out if it's not used.

So please point them to the problem and I'll double check how to avoid the problem on the RouteConverter side since the namespace http://www.garmin.com/xmlschemas/WaypointExtension/v1 is not used anymore after I've implemented support for http://www.garmin.com/xmlschemas/TrackPointExtension/v2 in release 2.12
--
Christian
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)