support GPX 1.1 too
[potlatch2.git] / net / systemeD / potlatch2 / utils / TrackLoader.as
index 03cb67d0aab829f82072f03d56916339b2e9f84c..4a0e170107a2eb1ad015342a5a21bcb6103c879d 100644 (file)
@@ -47,8 +47,12 @@ package net.systemeD.potlatch2.utils {
                }
 
                public function parseGPX(event:Event):void {
                }
 
                public function parseGPX(event:Event):void {
-            default xml namespace = new Namespace("http://www.topografix.com/GPX/1/0");
                        var file:XML = new XML(event.target.data);
                        var file:XML = new XML(event.target.data);
+                       for each (var ns:Namespace in file.namespaceDeclarations()) {
+                               if (ns.uri.match(/^http:\/\/www\.topografix\.com\/GPX\/1\/[01]$/)) {
+                                       default xml namespace = ns;
+                               }
+                       }
 
                        for each (var trkseg:XML in file..trkseg) {
                                var nodestring:Array = [];
 
                        for each (var trkseg:XML in file..trkseg) {
                                var nodestring:Array = [];