Modify

Opened 13 years ago

Closed 11 years ago

#1100 closed defect (fixed)

[PATCH] Tolerate minor errors in GPX loader

Reported by: Jekader Owned by: framm
Priority: minor Milestone:
Component: Core Version: latest
Keywords: Cc:

Description

JOSM doesn't want to open GPX files, generated by Nokia Sports Tracker.
Using today's josm-latest (rev 684)

the error is:
An invalid XML character (Unicode: 0x1) was found in the element content of the document.

The log is:

[jekader@jiku ~]$ /usr/java/jdk1.6.0_06/jre/bin/java -jar josm-latest.jar
mappaint: Using jar's elemstyles.xml: "jar:file:/home/jekader/josm-latest.jar!/styles/standard/elemstyles.xml"
loading wmsplugin
loading measurement
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x1) was found in the element content of the document.
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
        at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
        at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388)
        at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2879)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:508)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
        at org.openstreetmap.josm.io.GpxReader.<init>(GpxReader.java:295)
        at org.openstreetmap.josm.actions.OpenAction.openFileAsGpx(OpenAction.java:87)
        at org.openstreetmap.josm.actions.OpenAction.openFile(OpenAction.java:57)
        at org.openstreetmap.josm.actions.OpenAction.actionPerformed(OpenAction.java:48)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
        at java.awt.Component.processMouseEvent(Component.java:6041)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
        at java.awt.Component.processEvent(Component.java:5806)
        at java.awt.Container.processEvent(Container.java:2058)
        at java.awt.Component.dispatchEventImpl(Component.java:4413)
        at java.awt.Container.dispatchEventImpl(Container.java:2116)
        at java.awt.Component.dispatchEvent(Component.java:4243)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
        at java.awt.Container.dispatchEventImpl(Container.java:2102)
        at java.awt.Window.dispatchEventImpl(Window.java:2440)
        at java.awt.Component.dispatchEvent(Component.java:4243)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)

I'll attach a GPX example to the ticket. The OSM website parses these files without problems, but really slow...

Attachments (3)

W20080706155647.gpx (43.0 KB) - added by anonymous 13 years ago.
GPX example
R151765661.rar (28.7 KB) - added by anonymous 11 years ago.
cannot be opened in JOSM
nokiabug.patch (1.6 KB) - added by bastiK 11 years ago.

Download all attachments as: .zip

Change History (9)

Changed 13 years ago by anonymous

Attachment: W20080706155647.gpx added

GPX example

comment:1 Changed 12 years ago by jekader

found out what was causing the error. When I removed the <author><name></name></author> section - the file was successfully opened!

Thу tag should contain my name - it's written in cyrillics, as "Женя" - probably Sports Tracker doesn't like that...

comment:2 Changed 12 years ago by anonymous

Summary: Error opening GPX filesTolerate errors in GPS loader

Actually the file is defective, but probably the loader should tolerate some errors.

comment:3 Changed 12 years ago by anonymous

Summary: Tolerate errors in GPS loaderTolerate minor errors in GPX loader

Aaargh.

comment:4 Changed 11 years ago by anonymous

This bug is still present in the latest build, I cannot see any tracks recorded with Nokia Sports Tracker on my Nokia 5800 XM. Can anybody please fix this?

Changed 11 years ago by anonymous

Attachment: R151765661.rar added

cannot be opened in JOSM

comment:5 Changed 11 years ago by bastiK

Summary: Tolerate minor errors in GPX loader[PATCH] Tolerate minor errors in GPX loader

Changed 11 years ago by bastiK

Attachment: nokiabug.patch added

comment:6 Changed 11 years ago by Gubaer

Resolution: fixed
Status: newclosed

(In [2342]) applied #1100: patch by bastikK: Tolerate minor errors in GPX loader

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain framm.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.