Bug on LoadXMLTree with "choice_content" and "multichoice_content" fixed
authorlbessard
Mon, 05 Nov 2007 09:41:12 +0100
changeset 119 564564136c79
parent 118 0c53d6a36013
child 120 add8e391e00c
Bug on LoadXMLTree with "choice_content" and "multichoice_content" fixed
xmlclass/xmlclass.py
--- a/xmlclass/xmlclass.py	Tue Oct 30 16:53:08 2007 +0100
+++ b/xmlclass/xmlclass.py	Mon Nov 05 09:41:12 2007 +0100
@@ -679,11 +679,7 @@
                         attr_type = members["choice_content"][name]
                         # Extracts the value
                         if attr_type.startswith("bse:"):
-                            attr_value = GetAttributeValue(node)
-                            if write_type != "optional" or attr_value != "":
-                                val = GetComputedValue(attr_type.replace("[]",""), attr_value)
-                            else:
-                                val = None
+                            val = GetComputedValue(attr_type.replace("[]",""), GetAttributeValue(node))
                         elif attr_type.startswith("cls:"):
                             val = classes[attr_type[4:].replace("[]","")]()
                             val.loadXMLTree(node)
@@ -702,11 +698,7 @@
                         attr_type = members["multichoice_content"][name]
                         # Extracts the value
                         if attr_type.startswith("bse:"):
-                            attr_value = GetAttributeValue(node)
-                            if write_type != "optional" or attr_value != "":
-                                val = GetComputedValue(attr_type, attr_value)
-                            else:
-                                val = None
+                            val = GetComputedValue(attr_type, GetAttributeValue(node))
                         elif attr_type.startswith("cls:"):
                             val = classes[attr_type[4:]]()
                             val.loadXMLTree(node)