I am dealing with creating XML file on the base of schema.
Problem is with type recognition while assigning values to objects.
My schema defines 2 simple types A and B (<xs:simpleType>) both similar but B has extra pattern restriction.
Pyxb bidding classes ('An atomic simple type') are generated automatically in a way, that B inherits from A.
When I assign value to a complex element that is B type (by schema) just passing a string, the type of this element is recognized incorrectly.
This does not performs pattern validation once building document .validateBinding() method - due to wrong type.
my_elem = myschema_biddings() # some complex element
my_elem.Nm = "Foo" # no pattern validation !
type(my_elem.Nm) = <class 'myschema_bidddings.A'> # wrong
my_elem.Nm = myschema_biddings.B("Bar")
type(my_elem.Nm) = <class'myschema_bidddings.B'> # correct
Hello,
I am dealing with creating XML file on the base of schema.
Problem is with type recognition while assigning values to objects.
My schema defines 2 simple types A and B (<xs:simpleType>) both similar but B has extra pattern restriction.
Pyxb bidding classes ('An atomic simple type') are generated automatically in a way, that B inherits from A.
When I assign value to a complex element that is B type (by schema) just passing a string, the type of this element is recognized incorrectly.
This does not performs pattern validation once building document .validateBinding() method - due to wrong type.
I have asked this question on stack where You might find maybe some more details: http://stackoverflow.com/questions/43890710/pyxb-wrongly-recognises-simple-type
Any help appreciated!
Update your StackOverflow post with the schema description for an element that uses those types and I'll answer it there.
Identified and resolved as github issue #78.