diff --git a/pisi/xmlext.py b/pisi/xmlext.py index 97819846..51f572cf 100644 --- a/pisi/xmlext.py +++ b/pisi/xmlext.py @@ -132,7 +132,9 @@ def addTagPath(dom, node, tags, newnode=None): return node def addNode(dom, node, tagpath, newnode = None): - """add a new node at the end of the tree""" + """add a new node at the end of the tree + if newnode is given adds that node, too + returns the last node processed""" assert type(tagpath)==str tags = [] @@ -140,7 +142,7 @@ def addNode(dom, node, tagpath, newnode = None): tags = tagpath.split('/') # tag chain else: addTagPath(dom, node, [], newnode) - return node + return node #FIXME: is this correct!?!? assert len(tags)>0 # we want a chain diff --git a/pisi/xmlfile.py b/pisi/xmlfile.py index c9ac0e20..b981f82b 100644 --- a/pisi/xmlfile.py +++ b/pisi/xmlfile.py @@ -623,10 +623,8 @@ class autoxml(oo.autosuper): dom = node.ownerDocument if l and len(l) > 0: for item in l: - listnode = xml.newNode("Dummy") + listnode = addNode(dom, node, list_tagpath) encode_item(xml, listnode, item, errs) - node = getNode(listnode, comp_tag) - addNode(dom, node, path) else: if req is mandatory: errs.append(_('Mandatory list empty'))