problem parsing an XML file

This is the place for queries that don't fit in any of the other categories.

problem parsing an XML file

Postby tamir1400 » Mon Mar 18, 2013 12:17 pm

hey =)

i'm trying to write a simple script that would parse XML files.
the main thing i'm trying to do is just replace some of the characters in the file with others.

one of the characters i need to deal with is this one: ³

i used "coding: cp1255" in my program (using python 2.6 btw, not sure why).

anyway, i tried to delete every ³ character on the XML file, and writing the result to a new file.

my problem is this: when trying to open the new XML file after the parsing and without the "³" characters, windows tells me there's a problem with the file, and doesn't recognize it as a valid XML file.
although, when opening it as a .txt file, the only difference from the original file, is that every ³ was deleted.
i replace some other characters as well, but when the original file doesn't contain any "³", it actually works just fine. something about that weird character messes things up with the xml file, but i have no idea what's the problem.

i hope i was clear enough, and thanks in advance for any help =)
tamir1400
 
Posts: 1
Joined: Mon Mar 18, 2013 12:05 pm

Re: problem parsing an XML file

Postby setrofim » Mon Mar 18, 2013 1:08 pm

This sounds like an XML rather than a Python question. Could you be a bit more specific about the error you are getting (i.e. please post the exact error text)? What do you mean by
tamir1400 wrote:my problem is this: when trying to open the new XML file after the parsing and without the "³" characters, windows [ ... ] doesn't recognize it as a valid XML file.

? How are you trying to open the file?
setrofim
 
Posts: 288
Joined: Mon Mar 04, 2013 7:52 pm


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 5 guests

cron