* fix: make list encoding work again. I'm telling you, xmlext
is elegant. * errr. note for a suspicious line in xmlext.addNode
This commit is contained in:
+4
-2
@@ -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
|
||||
|
||||
|
||||
+1
-3
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user