How to parse XML inside the custom IML function?

Is there any way to parse XML string inside the the custom IML function?

What custom IML function? Please some more details. There’s a parser in tools that parses xml if memory serves me right.

@alex.newpath
API which I am using is returning an xml. I want to convert it to JSON. How can I do this? I know that there is “XML” module but I want to do the parsing inside my custom IML function.

Well then you’ll need to write the code in your IML function to parse xml. Javascript has an xml parser inside it but I don’t know if you can use it in a custom IML function.

Unfortunetely, it’s not possible to use window.DOMParser because window is undefined inside the IML function. Looks like custom IML functions are executed in Node.js environment.

In Node.js we can use i.e. GitHub - Leonidas-from-XIV/node-xml2js: XML to JavaScript object converter.
But this requires installing additional dependency. It is possible install a Node.js package to use it inside custom IML functions?

Thanks in advance

1 Like

I don’t think it’s possible to do this. But maybe there’s already something on make that you can lever. This is a question for their support.