default/fixed elements
Brought to you by:
pabigot
Is there support in pyxbgen (1.1.2) for elements with default or fixed values? I've had no problem with attributes coming through with defaults but elements do not. When I change the sample schema to have element defaults I do not see them in the resulting pyxbgen wrapper.
<xsd:element name="street" type="xsd:string" default="default street"/>
<xsd:element name="city" type="xsd:NMTOKEN" fixed="fixed city"/>
<xsd:attribute name="country" type="xsd:NMTOKEN" fixed="Works for attr"/>
The answer, as you may have surmised, is no, there is no such support. It may be a little tricky to add, or it may be trivial, as it appears I defined a method on the element use class that was intended to support default values.
Subset of tests required to validate this:
Fixed in following commit.
commit 7ec0c36d2005848bd5668482f906149a67c0a033
Author: Peter A. Bigot <pab@‌>
Date: Mon Dec 17 08:27:42 2012 -0600