Opened 15 years ago

Closed 15 years ago

#3004 closed defect (fixed)

Relax KML driver about xmlns

Reported by: Even Rouault Owned by: Even Rouault
Priority: normal Milestone: 1.6.2
Component: OGR_SF Version: unspecified
Severity: normal Keywords:
Cc: Mateusz Łoskot, condit

Description

Summary of a thread on gdal-dev (http://lists.osgeo.org/pipermail/gdal-dev/2009-May/020724.html)

Mateusz :

Would it make sense to relax a bit the KML driver here [1] so it
accepts <kml> root without xmlns attribute?

One user reported to me that he is not able to read this file [2]
using OGR KML driver and I found this is because of missing xmlns in
<kml> root element. The KML was produced by some unknown
software shipped with some GPS logger.

I'm wondering if there are more KML generators in use that
produce <kml> element without xmlns attribute

[1]
http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrsf_frmts/kml/kml.cpp#L268
[2] http://mateusz.loskot.net/tmp/gdal/no-xmlns.kml

Chris :

I see your point here. I think the onus is the software generating the
KML as it is part of the specification. How about this: if the document
element _is_ kml and the version _is not_ found or not recognized OGR
issues a warning and proceeds as if the KML were 2.2?

Even:

I've verified that the KML driver only looks for a known version (2.0, 2.1, 
2.2), but doesn't make any other use of it, so we could reasonably implement 
Christopher's proposal : "if the document element _is_ kml and the version 
_is not_ found or not recognized OGR issues a warning and proceeds as if the 
KML were 2.2"

Mateusz :

AFAICT, the schema version is not used anywhere in the driver, for
instance, to control conditional processing, etc.
So,for now, there seems to be little point to require presence of
xmlns attribute.

Change History (1)

comment:1 by Even Rouault, 15 years ago

Resolution: fixed
Status: newclosed

Done in trunk (r17074) and in branches/1.6 (r17075)

Note: See TracTickets for help on using tickets.