[gdal-dev] Problem reading folder name with <font> tag

Even Rouault even.rouault at spatialys.com
Fri Sep 5 08:33:52 PDT 2014


Zoppo,

I'm not completely convinced this is valid KML. According to the strict OGC KML
2.2 schema (http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd), I'd say this
would be invalid. And according to the historical looser specification at
https://developers.google.com/kml/documentation/kmlreference#name, this is not
mentionned as possible. But a lot of, more or less, valid KML files can be found
in the wild, so I'm half surprised. Although I would have expected seeing the
content between <name> and </name> to be encapsulated by <![CDATA[ and ]]>

To answer your question, code changes would be required in the KML driver. Not
sure if that would be possible in the LIBKML one if libkml library itself has no
provision to return all content, and not only the textual one.

Best regards,

Even


> Hello,
>
> I got a KML file where folder names aren't read completeley with OGR and
> libkml driver.
>
> I found the problem is the <name> tags contain <font> texts like i.e.:
>
> <Folder><name><font style="background-color: orangered;color:
> orangered">---</font> Data Centrum</name>...</Folder>
> <Folder><name><font style="color: Blue">Leased</font></name>...</Folder>
>
> In GoogleEarth these are evalutated and define the color the folders are
> shown.
>
> But in OGR the layer names result in ' Data Centrum' and ''
>
> I tried with KML driver too, there the first name is identical, the second
> one is some auto generated 'Layer #1' instead of empty text.
>
>
> Does anyone know if there's a way to retrieve the complete <name> content
> including the <font> (and maybe other HTML) tags?
>
>
> Thanks in advance,
>
> best regards,
>
> Zoppo
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list