[Marble-devel] Review Request 109377: Try to parse GPX-Files when they have no namespace declaration

Roman Karlstetter roman.karlstetter at googlemail.com
Tue Apr 9 19:17:43 UTC 2013



> On April 6, 2013, 2:31 p.m., Dennis Nienhüser wrote:
> > Do you have a sample .gpx file to test with? When I tried to load one of mine with the namespace removed manually, Marble failed to load it even with the patch applied.
> >
> 
> Roman Karlstetter wrote:
>     Yes you are right, it doesn't work for me either. So either I forgot something in my patch or I made some errors while testing it in the first place. I'll have a deeper look when I find the time.

This didn't work when I first tested it, don't ask me why I submitted this. 
The problem is that the tag handlers are registered with a namespace, and as the document has no namespace, no tag is recognized (the document is completely parsed, but no information is retrieved from it). There are some possibilities: 
 - register the handlers with an empty namespace: this is ugly, as tags are not unique anymore and could not be registered because there is already an implementation for a tag (then wrong handlers might get called). No, we don't want to go this way.
 - we don't parse files without namespace (they are in fact invalid). We should somehow tell the user that the file could not be loaded/parsed in this case.
 - if no namespace is specified in the doc, we assume a default namespace (in this case e.g. http://www.topografix.com/GPX/1/0). Each GeoParser would provide this information in a new method defaultNamespace() (a default implementation returns an empty string, plugins that aren't changed behave the same way as they do now). 

Any comments?


- Roman


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109377/#review30563
-----------------------------------------------------------


On April 6, 2013, 2:37 p.m., Roman Karlstetter wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/109377/
> -----------------------------------------------------------
> 
> (Updated April 6, 2013, 2:37 p.m.)
> 
> 
> Review request for Marble and Dennis Nienhüser.
> 
> 
> Description
> -------
> 
> Currently, when you try to load a track from a GPX-file with a missing namespace declaration, just nothing happens (file is not loaded and there is nothing indicating to the user that loading has failed). With this small patch, marble tries to parse a GPX file without a namespace declaration and prints a debug message.
> 
> Should there be a notification for the user when parsing (not just for GPX) fails? 
> 
> 
> This addresses bug 314482.
>     http://bugs.kde.org/show_bug.cgi?id=314482
> 
> 
> Diffs
> -----
> 
>   src/plugins/runner/gpx/GpxParser.cpp d1a32c2 
> 
> Diff: http://git.reviewboard.kde.org/r/109377/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Roman Karlstetter
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20130409/e7f8df33/attachment.html>


More information about the Marble-devel mailing list