diff --git a/pisi/xmlfile.py b/pisi/xmlfile.py index a2fed598..746bb8c3 100644 --- a/pisi/xmlfile.py +++ b/pisi/xmlfile.py @@ -462,13 +462,11 @@ class autoxml(type): return l def encode(xml, node, l): - listnode = xml.newNode(tag) if len(l) > 0: + listnode = xml.newNode(tag) for item in l: encode_item(xml, listnode, item) - #item_node = encode_item(xml, item) - #xml.addNodeUnder(listnode, comp_tag, item_node) - #return getNode(dummy, "Dummy") + node.appendChild(listnode) else: if req is mandatory: raise Error('Mandatory list empty') diff --git a/tests/xmlfiletests.py b/tests/xmlfiletests.py index 64a1bb82..b11ed2cf 100644 --- a/tests/xmlfiletests.py +++ b/tests/xmlfiletests.py @@ -40,7 +40,7 @@ class XmlFileTestCase(unittest.TestCase): t_Number = [types.IntType, xmlfile.optional] t_Email = [types.StringType, xmlfile.optional] a_href = [types.StringType, xmlfile.mandatory] - #t_Projects = [ [types.StringType], xmlfile.mandatory, 'Project'] + t_Projects = [ [types.StringType], xmlfile.mandatory, 'Project'] t_OtherInfo = [ OtherInfo, xmlfile.optional ] a = A()