I am using xml2js node to transform an json object to xml file. I want to set the array items element name when parsing my json
{
"myValue": "1",
"myItems": [
"13",
"14",
"15",
"16"
]
}
and i want it to look like (and set "element" tag to "myItem")
<root>
<myItems>
<element>13</element>
<element>14</element>
<element>15</element>
<element>16</element>
</myItems>
<myValue>1</myValue>
</root>
but xml2js just give me
<root>
<myItems>13</myItems>
<myItems>14</myItems>
<myItems>15</myItems>
<myItems>16</myItems>
<myValue>1</myValue>
</root>
Are there any options to set or I need to format my json on a certain way? To be able to set "element" tag name? I have the lastest update of xml2js today.