rendered paste bodydef categoryWalk(parent, outFile, level):
# category = {}
for node in parent.childNodes:
if node.nodeType == Node.ELEMENT_NODE:
if node.nodeName == 'RecipieType':
for child in node.childNodes:
if child.nodeType == Node.TEXT_NODE:
category[child.nodeValue] = child.nodeValue
outFile.write("Recipe Category: ")
categoryWalk(node, outFile, level+1)
categoryList = set(category)
print categoryList
# strCategory = string.join(categoryList)
# outFile.write(strCategory)
# outFile.write('\n')
# for categories in sorted(set(category)):
# print categories
# strCategory = string.join(set(category))
# outFile.write(strCategory)