[XML-SIG] Python Bindings to XML Schema system released
Peter A. Bigot
bigotp at acm.org
Sun Jun 21 02:22:20 CEST 2009
PyXB ("pixbee") is a pure Python package that generates Python source
code for classes that correspond to data structures defined by
XMLSchema. The generated classes support bi-directional conversion
between XML documents and Python instances. In concept it is similar to
JAXB for Java and CodeSynthesis XSD for C++.
Version 0.4.0, available from https://sourceforge.net/projects/pyxb, is
fairly complete, and supports the following features:
* Simple and complex type definitions
* List and union datatypes
* Constraints on (simple) datatypes (e.g., minInclusive, length)
* Model groups and attribute groups
* Complex content models (all, sequence, choice); minOccurs and
* Abstract types, xsi:type, substitution groups
* Nillable elements with xsi:nil
* Namespace qualified attributes and elements
* Class constants corresponding to string enumeration constraints
It successfully generates bindings for many of the major WS-I schemas,
such as WSDL and SOAP, as well as others like KML and SAML. A variety
of examples show how to use it with demonstration web services such as
the National Digital Forecast Database. The generated code can easily
be customized by subclassing the generated bindings. Both DOM and
SAX-based parsing are supported.
PyXB assumes a fairly strict interpretation of the XML Schema
specification, so web services using SOAP encodings with schemas but
being lax about namespaces and validation against content models can
sometimes be difficult to use. This may be addressed in a future release.
The documentation serves as the project's home page, and can be viewed
This is the initial public release, and I would appreciate any feedback.
More information about the XML-SIG