|
ContinuousWave Whaler Moderated Discussion Areas ContinuousWave: Small Boat Electrical Validating GPX file with XERCES
|
Author | Topic: Validating GPX file with XERCES |
jimh |
posted 09-22-2014 07:09 PM ET (US)
Validating GPX files using Xerces The GPX website suggests that GPX output can and should be validated for conformance to the GPX XML specification. The method suggested is to use the XML Parser XERCES. See http://www.topografix.com/gpx_validation.asp Installing XERCES for MacOS 10.6.8 required compiling a binary from the source distribution. This was greatly facilitated by a note from another user who found an important change that must be made in the process. See the instructions under the heading "1 Answer" at I compiled XERCES from
and then tested it by running the SAXcount utility against a sample file:
This output indicated a valid XML file. Then I tested a typical GPX file I had created from data on my chart plotter during a long cruise (to Isle Royale National Park in 2013):
The output was very long and contained a list of errors. Here are some examples: Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 2, char 90 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 2, char 90 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 2, char 90 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 3, char 15 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 4, char 15 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 5, char 21 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 6, char 20 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 7, char 19 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 10, char 10 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 11, char 15 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 12, char 17 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 13, char 58 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 13, char 58 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 13, char 58 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 14, char 23 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 15, char 28 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 16, char 22 Error at file /Users/jimh/xerces/xerces-c-3.1.1/samples/data/IRNP2013TrackOnly.gpx, line 18, char 58 As you can see, something is very wrong. The parser complains about every line in the file. Any XML, XERCES, or GPX experts out there that can help? |
acseatsri |
posted 09-22-2014 07:23 PM ET (US)
Not sure what you're trying to accomplish, but I convert Lowrance & Humminbird tracks and coordinates back and forth using GpsBabel without any fuss. |
jimh |
posted 09-23-2014 12:43 AM ET (US)
acseatsri says:
quote: I am trying to validate a GPX file I created. I use an XML parser called XERCES that I compiled from the source code on my MacOS 10.6.8 machine. The XERCES package compiled and installed without error, and the utility SAXcount runs fine on the sample XML file. When I run SAXcount against my GPX file, the parser finds hundreds of errors. Complicating the testing of my installation: the sample GPX files on the GPX website are no longer available; they're all dead links. I think the compiled package I installed is working. I am trying to figure out if if my GPX files are really not valid or if there is something awry with my XERCES installation. acseatsri says:
quote: That is great, but it does not help me validate GPX files with XERCES. You ought to use GPX files. Then you would not need to bother will all the addition work of using GPSBABEL. |
jimh |
posted 09-23-2014 01:12 AM ET (US)
By the way, I can only work on this problem first thing in the morning with a fresh cup of coffee. By 11 a.m. my brain is too mushy to work on Unix command line utilities. |
jimh |
posted 09-23-2014 01:30 PM ET (US)
I think my problem is there is no DTD for GPX on my system. I will continue to work on this. |
Powered by: Ultimate Bulletin Board, Freeware Version 2000
Purchase our Licensed Version- which adds many more features!
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.