[xsd-users] cxx-parser: run time difficulties with KML21.xsd

David White dawhite32 at gmail.com
Tue Jun 8 07:37:26 EDT 2010


Hi Boris,

> Which is invalid per the KML schema. Just add the following attributes
> and try it without the dont_validate flag:
>
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://earth.google.com/kml/2.1 kml21.xsd"
>
Ok, Done.

> I have modified the test driver to add support for polymorphism:
>
> http://www.codesynthesis.com/~boris/tmp/kml21-pdriver.cxx
>

Thank you for doing this.  Sorry to be a pest - something is still amiss.  Can you confirm whether you compiled this file and parsed a sample kml file?  After compiling, I am still getting the error message

error: Unknown element 'kml'

For clarity, I ran

xsd cxx-parser --force-overwrite --generate-print-impl --generate-polymorphic --root-element kml --namespace-map http://earth.google.com/kml/2.1=kml kml21.xsd

which produced kml21-pskel.cxx/hxx and kml21-pimpl.cxx/hxx.  I added true to the list of arguments passed to the ml_schema::document constructor in your kml21-pdriver.cxx.

::xml_schema::document doc_p (
       KmlType_p_,
       "http://earth.google.com/kml/2.1",
       "kml",
       true);

All files compile OK.

Thanks again, David.



<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://earth.google.com/kml/2.1 kml21.xsd">
<Style id="obi-normal">

     <IconStyle>

     <scale>0.5</scale>

     <Icon><href>http://maps.google.com/mapfiles/kml/pal4/icon17.png</href></Icon>

     </IconStyle>

</Style>

<Placemark>
     <name>Jerilderie</name>
     <description>Town of Jerilderie</description>
     <styleUrl>#obi-normal</styleUrl>

	<Point>
     <coordinates>145.72925,-35.3565,16000.0</coordinates>
     </Point>
</Placemark>
</kml>



More information about the xsd-users mailing list