I am going to send XML response from my node js api. Currently I am using xml - npm
CodePudding user response:
Colon in the tag means namespace prefix, and because you're missing a g:
namespace, it's rather not a valid XML, than a node-xml problem.
you need to define namespace, looks like Google Merchant, so try adding it in the root's _attr
like this:
{
toys: [
{
_attr: {
decade: '80s',
locale: 'US',
"xmlns:g": "http://base.google.com/ns/1.0"
//...