[ad_1]
I am trying to parse the XML and query the content but I see an error xmldoc.querySelector is not a function, this error seems weird because, I only find it when I run my code on AWS Lambda( Node.js 12.x) but not when I run it on the online compilers like playcode.io. Please refer the following code.
const tmpl =
tmpl = `<doc>
<request>
<delta>
</delta>
</request>
</doc>`
const xmldoc = new DOMParser().parseFromString(
tmpl,
'text/xml'
);
let dest = xmldoc.querySelector('order')
ERROR MESSAGE -> "stack": "TypeError: xmldoc.querySelector is not a function
Any help on this will be appreciated.
Thank you!
[ad_2]