#193 PyXB rejects restriction that changes element type

PyXB 1.2.2
closed
None
fixed
Component model
major
PyXB 1.2.1
defect
2013-03-11
2013-03-11
No

See https://sourceforge.net/p/pyxb/discussion/956708/thread/ffc7f0fe/#cee0

The restriction changes the element type to a new type that is not related to the original type. This may or may not be valid; the XML Schema Validator accepts it, though, so we'll consider it a PyXB bug.

Discussion

  • Peter A. Bigot

    Peter A. Bigot - 2013-03-11
    • status changed from new to accepted

    While PyXB would be correct in doing this if the restriction type were not related to the original type, in fact the restriction to xs:int given a base of xs:integer is valid, since xs:int is itself derived from xs:integer. PyXB does not correctly maintain this derivation information for built-in types.

     
  • Peter A. Bigot

    Peter A. Bigot - 2013-03-11
    • status changed from accepted to closed
    • resolution set to fixed

    Fixed in next branch in following commit.

    commit 609b199b19b4aa833d4961def9e2ff1fded4bc7a
    Author: Peter A. Bigot <pab@pabigot.com>
    Date:   Mon Mar 11 16:29:05 2013 -0500
    
        trac/193: PyXB rejects restriction that changes element type
    
        When creating the structural description of a built-in type that is derived,
        retain the derivation relationship (which is always "restriction" for
        derived simple types).  Do not simply accept any restriction, but only
        restrictions where the parent type is derivation consistent with the base.
    
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks