Modify

Opened 16 years ago

Closed 15 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 16 years ago.
GPX example
R151765661.rar (28.7 KB ) - added by anonymous 15 years ago.
cannot be opened in JOSM
nokiabug.patch (1.6 KB ) - added by bastiK 15 years ago.

Download all attachments as: .zip

Change History (9)

by anonymous, 16 years ago

Attachment: W20080706155647.gpx added

GPX example

comment:1 by jekader, 16 years ago

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 by anonymous, 16 years ago

Summary: Error opening GPX filesTolerate errors in GPS loader

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

comment:3 by anonymous, 16 years ago

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

Aaargh.

comment:4 by anonymous, 15 years ago

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?

by anonymous, 15 years ago

Attachment: R151765661.rar added

cannot be opened in JOSM

comment:5 by bastiK, 15 years ago

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

by bastiK, 15 years ago

Attachment: nokiabug.patch added

comment:6 by Gubaer, 15 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.