April 23rd, 2004, 06:04 AM
parsing xml with strange characters
I am trying to parse a xml. In this xml file I have the following entry:
I parse with the following functions:
file is the file with the entry.
from xml.dom import minidom
xmldoc = minidom.parse(file)
I tried to change some encodings in my xml file, but sometimes I get an error and otherwise I don't get an error, but the entry is not shown.
Is there a way to solve this in python or do I have to do something with my xml file (but that belongs to the xml forum)
April 23rd, 2004, 07:02 AM
There is a way to specify encodings in Python files, see
but I'm not sure if it solves your problem. I had a similar problem that wasn't solved by this or by changing the encoding of the xml file. I still got an error in a function in the expat library (which is the basis for the Python xml functions). You can use entities instead, é in your case.
April 23rd, 2004, 09:17 AM
thanks, but its already solved now , someone at my company helped me very good.
it was all decoding en encoding stuff, I solved it with the utf-8 encoding.
Have a nice weekend,