We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When building a XML from a JSON object (using the Builder class), arrays are interpreted as objects.
Trying to simplify, the following JSON Object
var j = { "samples": [ { "sample": { "id": "1" } }, { "sample": { "id": "2" } } ] };
And the following Builder:
var builder = new xml2js.Builder({ renderOpts: { "pretty": false }, xmldec: { version: "1.0" } });
The generated XML is (notice the indexes):
<?xml version="1.0"?> <samples> <0> <sample> <id>1</id> </sample> </0> <1> <sample> <id>2</id> </sample> </1> </samples>
And it should be
<?xml version="1.0"?> <samples> <sample> <id>1</id> </sample> <sample> <id>2</id> </sample> </samples>
Am I missing something?
I think the error is in line 125 of xml2js.coffee element = arguments.callee(element.ele(key), entry).up()
And how do I get the id to be generated as an attribute?
Thanks.
The text was updated successfully, but these errors were encountered:
Looks like a duplicate of #119, therefore closing. Please contribute in the other bug report.
Sorry, something went wrong.
No branches or pull requests
When building a XML from a JSON object (using the Builder class), arrays are interpreted as objects.
Trying to simplify, the following JSON Object
And the following Builder:
The generated XML is (notice the indexes):
And it should be
Am I missing something?
I think the error is in line 125 of xml2js.coffee
element = arguments.callee(element.ele(key), entry).up()
And how do I get the id to be generated as an attribute?
Thanks.
The text was updated successfully, but these errors were encountered: