Sorry please ignore... I changed the path to c:\temp\test.xml and it worked
just fine.
I'm sure I'll have some questions when I actually start playing with it though.
Lukas
________________________________
________________________________
From: Lukas Agrapidis <[email protected]>
To: [email protected]
Sent: Saturday, March 14, 2009 6:30:35 PM
Subject: [Tutor] Parse XML file
I am trying to parse an XML file using Python and found this resource
http://diveintopython.org/xml_processing/parsing_xml.html
But I didn't even get past the second line... it does not see the xml file?
But it is there.
>>> from xml.dom import minidom >>> xmldoc =
>>> minidom.parse('~/Desktop/test/test.xml')
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
xmldoc = minidom.parse('~/Desktop/test/test.xml')
File "C:\Program Files\python26\lib\xml\dom\minidom.py", line 1918, in parse
return expatbuilder.parse(file)
File "C:\Program Files\python26\lib\xml\dom\expatbuilder.py", line 922, in
parse
fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory: '~/Desktop/test/test.xml'
>>>
Lukas
_______________________________________________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor