tkrajina / gpxpy

gpx-py is a python GPX parser. GPX (GPS eXchange Format) is an XML based file format for GPS tracks.
Apache License 2.0
1.01k stars 223 forks source link

Extracting namespace element / attribute values #207

Closed lakeuk closed 4 years ago

lakeuk commented 4 years ago

How do I extract element / attribute values contained under the groundspeak namespace, below sample gpx and my basic code so far using examples. I've see examples using extensions but these have a extension element included which my gpx doesn't hold.

`<?xml version='1.0' encoding='UTF-8' standalone='yes' ?>

GC00000 Cache Name https://coord.info/GC00000 Cache Name Geocache Geocache|Traditional Cache cache name me cache owner Traditional Cache Micro ` `import gpxpy gpx_file = open('sample.xml', 'r', encoding='utf8') gpx = gpxpy.parse(gpx_file) for wpt in gpx.waypoints: print(wpt.name)`
tkrajina commented 4 years ago

Hi @lakeuk

As you already said -- this is not an extension. Gpxpy can't handle it.