All pastes #674319 Raw Edit

Untitled

public text v1 · immutable
#674319 ·published 2007-08-29 03:48 UTC
rendered paste body
def 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)