Hi I need one help When I am using xml2js node js lib. I am able to convert the XML to JSON object however when I am iterating JSON element I can see the '$': as few of the key elements. Is there a way I can eliminate the $ key ?
XML2JS conversion in nodejs
433 views Asked by Mohsin Khan At
2
There are 2 answers
0
On
You can use attrkey
to change the $
key to sth else.
Or you can ignore it (do not create attribute node) with ignoreAttrs
set to true
as per the readme of xml2js
try regex to replace the $ key
or
use JSON.parse() to replace the $.