Opened 15 years ago
Closed 11 years ago
#2724 closed enhancement (wontfix)
[PATCH] Validate GPX
Reported by: | hampelratte | Owned by: | team |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Core | Version: | |
Keywords: | gpx | Cc: | hampelratte |
Description (last modified by )
I have created a patch, which enables validation of GPX files, when they are imported. If an error occurs, a JOptionPane pops up with details from the parser (line, column and error msg).
This shall encourage developers of other software to make their software GPX compliant and inform JOSM users, that it's not JOSM fault, that a file can't be read.
Attachments (1)
Change History (8)
by , 15 years ago
Attachment: | validate_gpx.diff.gz added |
---|
comment:1 by , 15 years ago
Summary: | [PATCH] Validate GPX → Validate GPX |
---|
comment:2 by , 15 years ago
Enabling another parser feature:
factory.setFeature("http://apache.org/xml/features/validation/dynamic", true);
enables the parsing only for files, which specify a grammar (schema or dtd).
comment:4 by , 15 years ago
Not removing, but adding this line fixes the problem with the example you posted, because it doesn't specify a schema nor a dtd. So no validation will be done. Invalid files, which specify a dtd or a schema will still fail with an error message.
comment:5 by , 12 years ago
Description: | modified (diff) |
---|---|
Keywords: | gpx added |
comment:6 by , 12 years ago
Summary: | Validate GPX → [PATCH] Validate GPX |
---|
comment:7 by , 11 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
I'm still not convinced and it works fine without. We follow the rule strict for exports, liberal for imports.
A serious problem of this patch is, that files previously opening fine now fail to load, e.g. this example form another bug report.
Whereas warning the user about defect files is a nice idea enforcing standards behaviour is not.
In its current form I will not apply this patch.