I need some help...

I parsed an xml file using the minidom.parse method, but when i
printed the document object to the screen (using toxml() function), i noticed that the parser automatically replaced my " (inverted commas) chars into ' chars.

for example :

<Son_Tag title=' "Son" '>
This is an "example

turned out to be :

<Son_Tag title=" &quot;Son&quot; ">
This is an &quot;example

as a result, the &quot; replaced the inverted commas (") that i added.
this shit really messes up my program!

can anyone help me?

Recommended Answers

What is a &quot supposed to mean? Are you sure you are using PHP?

Jump to Post

All 4 Replies

What is a &quot supposed to mean? Are you sure you are using PHP?

I think Avner doesn't want his double quotes replaced by single quotes? I have seen this happen with Python before, but it didn't make any difference. Other languages ar not quite so forgiving. The &quot is an HTML/XML thing.

yea but actually it's the opposite, my single quotes are replaced by double quotes, and the double quotes remains the same, so i can't really use double quotes as part of a string...

What would happen if you wrote ' \"Son\" ' rather than ' "Son" ' ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.