# HG changeset patch # User lbessard # Date 1194252072 -3600 # Node ID 564564136c798ef4705a2c80d718b6ab5e1b646e # Parent 0c53d6a36013fdce458289b76fd42095b7eb3634 Bug on LoadXMLTree with "choice_content" and "multichoice_content" fixed diff -r 0c53d6a36013 -r 564564136c79 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)