--- a/xmlclass/xmlclass.py Sat Apr 06 11:57:03 2013 +0200
+++ b/xmlclass/xmlclass.py Tue Apr 09 18:16:04 2013 +0200
@@ -1670,7 +1670,12 @@
if attributes[parts[0]]["attr_type"]["basename"] == "boolean":
setattr(self, parts[0], value)
elif attributes[parts[0]]["use"] == "optional" and value == "":
- setattr(self, parts[0], None)
+ if attributes[parts[0]].has_key("default"):
+ setattr(self, parts[0],
+ attributes[parts[0]]["attr_type"]["extract"](
+ attributes[parts[0]]["default"], False))
+ else:
+ setattr(self, parts[0], None)
else:
setattr(self, parts[0], attributes[parts[0]]["attr_type"]["extract"](value, False))
elif elements.has_key(parts[0]):