Skip to content

Commit 701d4cc

Browse files
committed
Make created GPX file valid
Validated with SAXCount from the xerces-c package: $ SAXCount -v=always -n -s -f notes.gpx Error messages before this change: Error at file /home/markus/note.gpx, line 2, char 84 Message: no declaration found for element 'gpx' Error at file /home/markus/note.gpx, line 2, char 84 Message: attribute 'version' is not declared for element 'gpx' Error at file /home/markus/note.gpx, line 2, char 84 Message: attribute 'creator' is not declared for element 'gpx' Error at file /home/markus/note.gpx, line 2, char 84 Message: attribute 'xmlns' is not declared for element 'gpx' Error at file /home/markus/note.gpx, line 3, char 41 Message: no declaration found for element 'wpt' Error at file /home/markus/note.gpx, line 3, char 41 Message: attribute 'lat' is not declared for element 'wpt' Error at file /home/markus/note.gpx, line 3, char 41 Message: attribute 'lon' is not declared for element 'wpt' Error at file /home/markus/note.gpx, line 4, char 11 Message: no declaration found for element 'name' Error at file /home/markus/note.gpx, line 5, char 10 Message: no declaration found for element 'cmt'
1 parent 09a4373 commit 701d4cc

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

osmnotes.pl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
$gpxroot->addChild($final_gpx->createAttribute(version => '1.1'));
8888
$gpxroot->addChild($final_gpx->createAttribute(creator => 'osmnotes.pl'));
8989
$gpxroot->addChild($final_gpx->createAttribute(xmlns => 'http://www.topografix.com/GPX/1/1'));
90+
$gpxroot->addChild($final_gpx->createAttribute('xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance'));
91+
$gpxroot->addChild($final_gpx->createAttribute('xsi:schemaLocation' => 'http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd'));
9092

9193
sub parse_note {
9294
my ($note) = @_;

0 commit comments

Comments
 (0)