dylang / dylang/node-xml

It is giving error while working with keys having : in it

Open
#46 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
283
Forks
50
PR merge metrics
No merged PRs in 30d

Description

I am going to send XML response from my node js api.

When I am sending data like following

```
res.set('Content-Type', 'text/xml');

let example5 = [
{
toys: [
{
_attr: {
decade: '80s',
locale: 'US'
}
},
{
toy: 'Transformers'
},
{
toy: [
{
_attr: {
knowing: 'half the battle'
}
},
'GI Joe'
]
},
{
toy: [
{
name: 'He-man'
},
{
'g:brand': 'He-man'
},
{
description: {
_cdata: 'Master of the Universe!'
}
}
]
}
]
}
]

return res.send(xml(example5, true));
```

When using the key with : it is giving error like this
![xml_error](https://user-images.githubusercontent.com/3204992/156008070-da3d9a8f-491a-4a10-98b7-30c2361485e4.jpg)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.