Complete the XML parsing

This commit is contained in:
Veronica Berglyd Olsen
2022-10-30 22:51:31 +01:00
parent 6d1734b655
commit ea80fd3c71
5 changed files with 447 additions and 241 deletions
+5 -9
View File
@@ -126,18 +126,14 @@ class NWTree:
tItem.packXML(xContent)
return
def unpackXML(self, xContent):
"""Iterate through all items of a content XML object and add
them to the project tree.
def unpack(self, data):
"""Iterate through all items of a list and add them to the
project tree.
"""
if xContent.tag != "content":
logger.error("XML entry is not a NWTree")
return False
self.clear()
for xItem in xContent:
for item in data:
nwItem = NWItem(self.theProject)
if nwItem.unpackXML(xItem):
if nwItem.unpack(item):
self.append(nwItem.itemHandle, nwItem.itemParent, nwItem)
nwItem.saveInitialCount()