* 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:
Eray Özkural
2005-11-02 02:04:10 +00:00
parent 216db55d34
commit 175e4618a2
2 changed files with 5 additions and 5 deletions
+4 -2
View File
@@ -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
View File
@@ -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'))