Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrays not handled correctly #4

Closed
GoogleCodeExporter opened this issue Nov 9, 2015 · 2 comments
Closed

Arrays not handled correctly #4

GoogleCodeExporter opened this issue Nov 9, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
Run these two lines in your JavaScript console:
1. var xmlStr = "<xml><title name='MODE'>show</title><title 
name='VAR'>me</title></xml>"
2. X2JS.json2xml_str(X2JS.xml_str2json(xmlStr))


What is the expected output? What do you see instead?
Expected output: "<xml><title name='MODE'>show</title><title 
name='VAR'>me</title></xml>"
Actual output: "<xml><title></title><title></title></xml>"

What version of the product are you using? On what operating system?
Using version 1.0.7 in Chrome

Please provide any additional information below.
I fixed this by making a 5 line change to version 1.0.6**. My file is attached.

The for loop at line 196 now is:

for(var arIdx = 0; arIdx < subObj.length; arIdx++) {
    if(arrayOfObjects){
        var arrObj = {};
    arrObj[it] = subObj[arIdx];
    result+=parseJSONObject(arrObj);
    } else {
         ...
    }}


** Link to version 1.0.6: 
http://code.google.com/p/x2js/source/browse/xml2json.js?spec=svn8326889cdfbe9512
26417adbed94952ef9d7a06f&r=ee0824ba76a41fe7be65546e145ccd591f9dc662

Original issue reported on code.google.com by paulmed...@gmail.com on 15 Oct 2012 at 2:55

Attachments:

@GoogleCodeExporter
Copy link
Author

Working on it
Thank you for submit issue!

Original comment by abdulla....@gmail.com on 18 Oct 2012 at 5:49

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Fixed in 1.0.8.
Thank you!

Original comment by abdulla....@gmail.com on 18 Oct 2012 at 8:58

  • Changed state: Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant