Created
January 29, 2012 22:14
-
-
Save BMorearty/1700990 to your computer and use it in GitHub Desktop.
Tries to parse XML file and print node names. Fails if it has null bytes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from xml.dom.pulldom import START_ELEMENT, END_ELEMENT, parse | |
from xml.sax import SAXParseException | |
doc = parse("mal.xml") | |
for event, node in doc: | |
if event == START_ELEMENT: | |
print node.nodeName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this sample data file to reproduce the problem.