eth4io / libkml

Automatically exported from code.google.com/p/libkml
Other
0 stars 0 forks source link

Invalid Token #156

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
All,

I converted a rather large shapefile to KML using ogr2ogr. The problem is that 
I get a "not well-formed (invalid token) on line x" error and it's caused by 
additional markup added to some of the attribute fields in the <SimpleData> 
tags. I am running the kmlregionator app that installs with libkml and this is 
where the error is being thrown.

What steps will reproduce the problem?
1. convert shp to KML using OGR2OGR
2. run ./kmlregionator input.kml output_dir
3. If there are embedded XML tags in the attribute fields, the app will choke.

What is the expected output? What do you see instead?
Nothing!

What version of the product are you using? On what operating system?
Todays build from SVN

Did you run the unit test suite that comes with the project? Did all tests pass?
Yep

Please provide any additional information below.
For some reason, the XML tag <91> is being added to some of the SimpleData tags 
and libkml chokes on it. Is there anyway to move past these types of issues?

Original issue reported on code.google.com by estrada....@gmail.com on 19 Aug 2010 at 2:25

GoogleCodeExporter commented 8 years ago
Sounds like ogr2ogr is generating invalid XML. Is the <91> tag not closed? 

The "not well-formed" error is coming from expat, the XML parser libkml uses, 
so there's nothing libkml can do to help you there. 

(Technically you could hack kml_handler's StartElement to detect the <91> and 
throw it away, but if ogr2ogr is broken, file a bug with the fine folks over at 
gdal.)

Original comment by kml.mash...@gmail.com on 19 Aug 2010 at 4:47