]> gitweb.fperrin.net Git - GpsPrune.git/blobdiff - tim/prune/load/xml/ZipFileLoader.java
Version 16, February 2014
[GpsPrune.git] / tim / prune / load / xml / ZipFileLoader.java
index fff0d92aa67f1587aa6e311411bc1f43caecd293..eb2f9a604d3aefd2fabcb9ad33f73ec2004dde28 100644 (file)
@@ -11,7 +11,6 @@ import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 
 import tim.prune.App;
-import tim.prune.data.Altitude;
 import tim.prune.data.SourceInfo;
 import tim.prune.load.MediaLinkInfo;
 
@@ -57,8 +56,8 @@ public class ZipFileLoader
                                        if (suffix.equals(".kml") || suffix.equals(".gpx") || suffix.equals(".xml"))
                                        {
                                                _xmlLoader.reset();
-                                               SAXParser saxParser = SAXParserFactory.newInstance().newSAXParser();
-                                               saxParser.parse(file.getInputStream(entry), _xmlLoader);
+                                               // Parse the stream using either Xerces or java classes
+                                               _xmlLoader.parseXmlStream(file.getInputStream(entry));
                                                XmlHandler handler = _xmlLoader.getHandler();
                                                if (handler == null) {
                                                        _app.showErrorMessage("error.load.dialogtitle", "error.load.othererror");
@@ -69,7 +68,7 @@ public class ZipFileLoader
                                                        SourceInfo sourceInfo = new SourceInfo(inFile,
                                                                (handler instanceof GpxHandler?SourceInfo.FILE_TYPE.GPX:SourceInfo.FILE_TYPE.KML));
                                                        _app.informDataLoaded(handler.getFieldArray(), handler.getDataArray(),
-                                                               Altitude.Format.METRES, sourceInfo, handler.getTrackNameList(),
+                                                               null, sourceInfo, handler.getTrackNameList(),
                                                                new MediaLinkInfo(inFile, handler.getLinkArray()));
                                                        xmlFound = true;
                                                }
@@ -117,7 +116,7 @@ public class ZipFileLoader
                                                {
                                                        // Send back to app
                                                        _app.informDataLoaded(handler.getFieldArray(), handler.getDataArray(),
-                                                               Altitude.Format.METRES, new SourceInfo("gpsies", SourceInfo.FILE_TYPE.GPSIES),
+                                                               new SourceInfo("gpsies", SourceInfo.FILE_TYPE.GPSIES),
                                                                handler.getTrackNameList());
                                                        xmlFound = true;
                                                }