pabigot / pyxb

Python XML Schema Bindings
Apache License 2.0
130 stars 74 forks source link

[BUG] nonNegativeInteger type implementation assumes 0 value on empty tag #71

Closed kozmaz87 closed 7 years ago

kozmaz87 commented 7 years ago

It should not pass validation if:

<myelem></myelem>

and myelem is of type="nonNegativeInteger"

pabigot commented 7 years ago

Confirmed. The problem probably exists in all types that subclass Python built-in scalars. No estimate on when a patch will be available.

kozmaz87 commented 7 years ago

I am trying to wrap my head around this with all the facets and _nil and whatnot to understand where to apply a fix to PR back. Unfortunately the usual subclass and _ConvertArguments_vx even with super call makes everything break in obscure unexpected ways. Very peculiar.