XML : GPXXMLSyntaxException: Error parsing XML: not well-formed (invalid token): line 1, column 11

I get this error when parsing a gpx file like so:

  gpx_file_object = open(path_and_file, 'r')  parser = gpxpy.parse(gpx_file_object)    

The gpx file looks like so:

  <?xml version='1.0' encoding='UTF-8'?>  <gpx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1" creator="EMNRD.GPXWriter" version="1.1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">    <time>01/07/2016  07:49:50</time>    <metadata>      <name>0/0</name>      <desc>24989196</desc>    </metadata>    <trk>      <name>0/0</name>      <trkseg>        <trkpt lat="35.000096" lon="-108.050042"/>        <trkpt lat="34.5277756667" lon="-108.050042"/>        <trkpt lat="34.5277756667" lon="-107.4452589"/>        <trkpt lat="35.000096" lon="-107.4452589"/>        <trkpt lat="34.000096" lon="-108.050042"/>      </trkseg>    </trk>  </gpx>    

This gpx file was generated by python code I wrote. I looked at the file in an editor, both in text and hex mode, and don't see anything unusual. I pasted the above into an xml validator and it passed. I loaded the gpx file into Mobac and it looks good.

I've read this question, no solution there for me:
Error:(1) Error parsing XML: not well-formed (invalid token)

Any suggestions?

No comments:

Post a Comment