Enatel / xmltojson

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

namespace url does not properly convert from json to xml #22

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Problem:

Namespace url http://www.example.org turns to http:://www.example.org 
when converting from JSON to XML.

What steps will reproduce the problem?

1. Run the the x2js html sample using the sample json:

{"MyOperation":{"test":"Success","test2":{"item":["ddsfg","dsdgfdgfd"],"item2":"
testArrSize","_myAttr":"SuccessAttrValueTest2"},"_xmlns:testns":"http:://www.exa
mple.org","__prefix":"testns"}}

What is the expected output? 

<testns:MyOperation 
xmlns:testns='http://www.example.org'><test>Success</test><test2 
myAttr='SuccessAttrValueTest2'><item>ddsfg</item><item>dsdgfdgfd</item><item2>te
stArrSize</item2></test2></testns:MyOperation>

What do you see instead?

<testns:MyOperation 
xmlns:testns='http::&#x2F;&#x2F;www.example.org'><test>Success</test><test2 
myAttr='SuccessAttrValueTest2'><item>ddsfg</item><item>dsdgfdgfd</item><item2>te
stArrSize</item2></test2></testns:MyOperation>

What version of the product are you using? On what operating system and
browser version?

x2js v 1.1.5
Chrome v 33.0.1750.117
OS X 10.9.1

Original issue reported on code.google.com by jc.ferre...@gmail.com on 2 Mar 2014 at 12:51

GoogleCodeExporter commented 8 years ago

Original comment by abdulla....@gmail.com on 2 Mar 2014 at 10:13

GoogleCodeExporter commented 8 years ago
Fixed in v1.1.6
Available at https://x2js.googlecode.com/hg/xml2json.js (in mercurial).
Thanks for the report!

Original comment by abdulla....@gmail.com on 2 Mar 2014 at 10:24

GoogleCodeExporter commented 8 years ago

Original comment by abdulla....@gmail.com on 2 Mar 2014 at 10:24