[gdal-dev] Relax KML driver about xmlns

Mateusz Loskot mateusz at loskot.net
Wed May 20 19:31:39 EDT 2009


Christopher Condit wrote:
> Hi Mateusz-
>> Would it make sense to relax a bit the KML driver here [1] so it
>> accepts <kml> root without xmlns attribute?
> 
> The problem is that the KML schema had many iterations before becoming
> an OGC standard and in some cases those schema changes are not backward
> compatible. The namespace exists to alert the client as to which version
> of the schema to expect. However - I'm not sure what portion of the
> schema that OGR uses actually changed.

Christopher,

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.

>> 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.
> 
> 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?

Yes, for me, this is a good idea.

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org


More information about the gdal-dev mailing list