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

Boris Kolpackov boris at codesynthesis.com
Mon May 31 09:03:36 EDT 2010


Hi David,

David White <dawhite32 at gmail.com> writes:

> I note that kml files have for the (root) kml element the following:
>
> [sample.kml]
> <?xml version="1.0" encoding="UTF-8"?>
> <kml xmlns="http://www.opengis.net/kml/2.1">

The kml21.xsd schema from Google website has the following target
namespace:

targetNamespace="http://earth.google.com/kml/2.1"

While your document uses "http://www.opengis.net/kml/2.1" as the
XML vocabulary namespace. These two will need to be the same.

As a side note, the KML schema uses polymorphism and you are using 
the --generate-print-impl option to generate the sample parser
implementations. These implementations are not polymorphism-aware
and will only print the data that is in the base type. For more 
information on how to handle polymorphic XML vocabularies with
the C++/Parser mapping, see Section 5.4, "Support for Polymorphism"
in the C++/Parser Mapping Getting Started Guide;

http://www.codesynthesis.com/projects/xsd/documentation/cxx/parser/guide/#5.4

Boris



More information about the xsd-users mailing list