#19 rework code generation to support optional validation

PyXB 2.0.0
closed
None
Content model
minor
enhancement
2014-06-06
2009-07-02
No

For speed in applications that don't care about correctness, provide a facility to store directly into the Python slots rather than pass through the content model validation.

Discussion

  • Peter A. Bigot

    Peter A. Bigot - 2009-07-12
    • status changed from new to accepted

    Not sure how well this can work. If we're creating a binding instance from Python values (as opposed to XML document content), we need to execute the content model to figure out which local element in the complex type can accept values of the given Python type. If we're processing a simple type of union variety, we need to validate the input against each member type to identify the correct wrapper.

    So at best we skip the occurrence constraint validation when creating elements from XML documents as long as we weren't going to check wildcard validation anyway, and the facet constraints on simple datatypes that aren't unions. We can also bypass type conversions when storing values in elements.

    You also then end up with an element binding where the contained values aren't of the correct type to reconstruct an XML document (e.g., the binding element is not associated with the values, which may not even be _TypeBinding_mixin instances).

    Yeah, you do get about a 30% decrease in time required to build an instance. But I don't care how fast I can get the wrong answer. I'll put this in, but it may not stay long, if it turns out changing the code generator is a better approach.

     
  • Peter A. Bigot

    Peter A. Bigot - 2009-07-16
    • milestone changed from PyXB 0.5.1 to PyXB 0.5.2

    Delayed to next beta.

     
  • Peter A. Bigot

    Peter A. Bigot - 2009-08-04
    • milestone changed from PyXB 0.5.2 to PyXB 0.7.1

    Pushed out until default binding style has changed to property.

     
  • Peter A. Bigot

    Peter A. Bigot - 2009-08-08
    • priority changed from major to minor
    • type changed from defect to enhancement
     
  • Peter A. Bigot

    Peter A. Bigot - 2009-08-23
    • milestone changed from PyXB 0.7.1 to PyXB 2.0.0

    See #44. With that, this is lower priority.

     
  • Peter A. Bigot

    Peter A. Bigot - 2014-06-06
    • Description has changed:

    Diff:

    
    
    • status: accepted --> closed
     
  • Peter A. Bigot

    Peter A. Bigot - 2014-06-06

    Closing NWF: after five years clearly this isn't a priority