Limitations

Things That Work

  • Class constants corresponding to string enumeration constraints
  • 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 maxOccurs
  • Abstract types, xsi:type, substitution groups
  • Nillable elements with xsi:nil
  • Namespace qualified attributes and elements
  • Documentation annotations present in the schema are converted to Python docstrings in the generated bindings.
  • Pattern constraints (as long as the simple type derives from something that is represented as a Python string)

Things That Don’t Work

...but could someday

  • Identity constraints (“key”, “unique”, “keyref”) are stored in the content model, but are not used.
  • Wildcard elements are supported in the sense that classes that enable them in the content model provide access to unrecognized values through the complexTypeDefinition.wildcardElements method. Where the type of the node is recognized, it is converted to a Python binding instance; otherwise, the xml DOM instance is stored. Although namespace constraints are applied when checking for wildcard matches, the process contents attribute of the wildcard is ignored.
  • Wildcard attributes are supported in much the same sense as wildcard elements: no constraints are checked, and all are aggregated into the complexTypeDefinition.wildcardAttributeMap. Values are uninterpreted Unicode strings.

...and probably never will

  • The redefine directive is not supported.
  • The ability to use templates to customize binding generation was promised in the vision document, but after three years of no plausible use case it is no longer part of the plan.

Things That Mostly Work, But They’re Ugly

  • The duration type is based on the Python datetime.timedelta class, which works reasonably well for small deltas but does not handle month and year deltas. The PyXB version records that information, but the timedelta functionality (adding/substracting from datetime instances) does not incorporate that portion of the delta. Negative durations also may not work properly.