pabigot / pyxb

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

duration: zero value produces invalid literal #38

Closed pabigot closed 9 years ago

pabigot commented 9 years ago

Transcribed from: https://sourceforge.net/p/pyxb/discussion/956708/thread/68bb2a3f/

Having a duration element <xs:element name="period" type="xs:duration"/>

In case the Python datetime.timedelta is 0, then Pyxb produce the following output with doesn't validate xs:duration.

<period>P</period>

It must produce some period value containing 0, e.g.

<period>P0D</period>