mohammed-najeeb / x2js

Automatically exported from code.google.com/p/x2js
0 stars 0 forks source link

escape "&" caractere #37

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. xml = "<out><test>foo & bar</test></out>";
2. json = x2js.xml_str2json(xml);

What is the expected output? 
json = {"out":{"test":"foo & bar"}}

What do you see instead?
json = null

What version of the product are you using? On what operating system and
browser version?
I'm on Firefox and It doesn't work on https://x2js.googlecode.com/hg/demo.html
I think this is the lastest version ...

Is there a fix or something to do ?
I can't modify xml that comes from the server.

Modifications have to be done on the xml or the plugin ?

Thanks in advance!

Original issue reported on code.google.com by Benc...@gmail.com on 2 Mar 2015 at 12:37

GoogleCodeExporter commented 9 years ago
try this
"xml = "<out><test>foo & bar</test></out>".
You can't use an unescaped "&" in well-formed XML and it won't be accepted by 
XML parsers in browsers as a valid document.

Original comment by abdulla....@gmail.com on 20 May 2015 at 9:57