question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

change in behavior from 1.3.2 to 1.4.1

See original GitHub issue

When an object contains an array(schema 1), the expected result in v.1.3.2 was one item with several sub items (schema 2). But now we have several items with one sub item each. (schema 3)

Schema 1 (data to convert):

var jstoxml = require("jstoxml")

jstoxml.toXML({Response: [
    {_name: "Play", _content: "first sound"},
    {_name: "Play", _content: "second sound"},
]});

Schema 2 (expected result):

<Response><Play>first sound</Play><Play>second sound</Play></Response>

Schema 3 (actual result):

<Response><Play>first sound</Play></Response><Response><Play>second sound</Play></Response>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sergebessoncommented, Jul 5, 2018

Thanks a lot ! It works just fine.

0reactions
davidcalhouncommented, Jul 6, 2018

@jimmdd No worries! I appreciate your help. I tweaked the code to only handle primitives and keep the old behavior for everything else (objects and special jstoxml objects).

If folks want an output like the above, they can easily get it with this notation:

toXML(
  [
    { t: [{ foo: 'bar' }] },
    { t: [{ foo: 'bar2' }] }
  ]
);

// -> '<t><foo>bar</foo></t><t><foo>bar2</foo></t>'
Read more comments on GitHub >

github_iconTop Results From Across the Web

What's new in 1.4.0 (January 22, 2022) - Pandas
This behaviour change has been reverted in pandas 1.4.3. When using concat() to concatenate two or more DataFrame objects, if one of the...
Read more >
ORR Unaccompanied Children Program Policy Guide
The ORR Unaccompanied Children Program Policy Guide is a summary of ORR policies for the placement, release and care of unaccompanied children in...
Read more >
How to Meet WCAG (Quick Reference) - W3C
Information and user interface components must be presentable to users in ways they can perceive. Guideline 1.1 – Text Alternatives. Provide text alternatives ......
Read more >
Releases · Atmosphere-NX/Atmosphere - GitHub
The following was changed since the last release: Support was improved for 14.0.0+. loader was updated to reflect the latest official behaviors.
Read more >
AngularJS: Developer Guide: Migrating from Previous Versions
Minor version releases in AngularJS introduce several breaking changes that ... This behavior is now supported via a special wildcard / catch-all key:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found