0

I am trying to create bindings using the kml schema http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd and the gx extension schema https://developers.google.com/kml/schema/kml22gx.xsd

I have no trouble generating and using the bindings generated from the ogckml22 schema. I am unclear as to how to incorporate the extension schema into these bindings.

1 Answers1

0

You don't incorporate the schema into those bindings. You generate a new bindings module for the extending schema (which has its own namespace), and make sure it references the existing bindings. Something like this[*]:

pyxbgen \
  --archive-path='&pyxb/bundles/opengis//' \
  --schema-location=http://code.google.com/apis/kml/schema/kml22gx.xsd \
  --module=kml22gx

The bindings for kml22gx will be subclasses of the pyxb.bundles.opengis.ogckml22 bindings that are being extended.

Look at the file pyxb/bundles/opengis/scripts/genbind which is what generates the bindings in PyXB itself. Several of the namespaces extend other OpenGIS namespaces for which bindings were generated in an earlier invocation of pyxbgen.

([*] When you do this, you may get an AssertionError. Comment out the assertion; it seems to be too restrictive.)

pabigot
  • 989
  • 7
  • 8