Parsing xml file

Reply

Join Date: Aug 2005
Posts: 18
Reputation: Avner .H. is an unknown quantity at this point 
Solved Threads: 0
Avner .H. Avner .H. is offline Offline
Newbie Poster

Parsing xml file

 
0
  #1
Aug 15th, 2005
Hello!
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 :

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

turned out to be :

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

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

can anyone help me?
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1,222
Reputation: bumsfeld will become famous soon enough bumsfeld will become famous soon enough 
Solved Threads: 136
bumsfeld's Avatar
bumsfeld bumsfeld is offline Offline
Nearly a Posting Virtuoso

Re: Parsing xml file

 
0
  #2
Aug 17th, 2005
What is a &quot supposed to mean? Are you sure you are using PHP?
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 3,941
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 911
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: Parsing xml file

 
0
  #3
Aug 18th, 2005
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.
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 18
Reputation: Avner .H. is an unknown quantity at this point 
Solved Threads: 0
Avner .H. Avner .H. is offline Offline
Newbie Poster

Re: Parsing xml file

 
0
  #4
Aug 21st, 2005
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...
Reply With Quote Quick reply to this message  
Join Date: Oct 2004
Posts: 3,941
Reputation: vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice vegaseat is just really nice 
Solved Threads: 911
Moderator
vegaseat's Avatar
vegaseat vegaseat is offline Offline
DaniWeb's Hypocrite

Re: Parsing xml file

 
0
  #5
Aug 21st, 2005
What would happen if you wrote ' \"Son\" ' rather than ' "Son" ' ?
May 'the Google' be with you!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC