You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XML documents cannot have more than one root element, so an array cannot be the root object that you pass into js2xmlparser (unless you're using the arrayMap functionality).
It's concerning that no error was thrown when you tried to do this, though.
Apologies, I found a similar issue in the closed issues section and closed this one.
If I parsed the data as JSON then the error appeared, however as I just sent it a String that contained the json data I guess it didn't know. It almost works though! I guess I could have just have done some regex on the xml and replaced the duplicate headers.
Usage :
var js2xmlparser = require("js2xmlparser");
var params = req.params.all();
var json = params.id;
result:
The text was updated successfully, but these errors were encountered: