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

0-depth issues #48

Closed
davidcalhoun opened this issue Jul 21, 2021 · 0 comments
Closed

0-depth issues #48

davidcalhoun opened this issue Jul 21, 2021 · 0 comments

Comments

@davidcalhoun
Copy link
Owner

There's some bugs in the code related to code at 0 depth outputting unexpected results, e.g.

const table = [
  {
    row: 'bar'
  },
  {
    row: 'bar2'
  }
];
const xmlOptions = {
  header: '<?xml version="1.0" encoding="UTF-16" standalone="yes"?>',
  indent: ' '
};

console.log(toXML(table, xmlOptions));

Outputs this:

<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<row>bar</row>
<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<row>bar2</row>

When it should output this:

<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
<row>bar</row>
<row>bar2</row>

Reference: https://stackoverflow.com/questions/68130732/cant-add-header-info-properly-using-jstoxml

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

No branches or pull requests

1 participant