ehem, yeni piksemel api

This commit is contained in:
Gürer Özen
2006-04-19 08:15:46 +00:00
parent e7084fddf4
commit fd688cc829
+4 -4
View File
@@ -49,7 +49,7 @@ def getNodeAttribute(node, attrname):
"""get named attribute from DOM node""" """get named attribute from DOM node"""
return node.getAttribute(attrname) return node.getAttribute(attrname)
def getChildElts(node): def getChildElts(parent):
"""get only child elements""" """get only child elements"""
return [x for x in parent.tags()] return [x for x in parent.tags()]
@@ -105,8 +105,8 @@ def addText(node, tagpath, text):
if node.getTag(tag): if node.getTag(tag):
node = node.getTag(tag) node = node.getTag(tag)
else: else:
node = node.appendTag(tag) node = node.insertTag(tag)
node.appendData(text) node.insertData(text)
def createTagPath(node, tags): def createTagPath(node, tags):
"""create new child at the end of a tag chain starting from node """create new child at the end of a tag chain starting from node
@@ -114,7 +114,7 @@ def createTagPath(node, tags):
if len(tags)==0: if len(tags)==0:
return node return node
for tag in tags: for tag in tags:
node = node.appendTag(tag) node = node.insertTag(tag)
return node return node
def addTagPath(node, tags, newnode=None): def addTagPath(node, tags, newnode=None):