from xml.dom import minidom, Nodedef scanNode(node, level = 0): msg = node.__class__.__name__ if node.nodeType == Node.ELEMENT_NODE: msg += ", tag: " + node.tagName print " " * level * 4, msg if node.hasChildNodes: for child in node.childNodes: scanNode(child, level + 1) doc = minidom.parse('sample.xml') scanNode(doc)
Name (required)
email (will not be published) (required)
Website