Hey there. A while back I had posted about a scri...
# suitescript
d
Hey there. A while back I had posted about a script that would convert an XML to JSON (and JSON to XML) and someone had show me a stackoverflow post (and code snippet). Of course, the history in this slack is limited. Any change that person is still out there and has that info?
s
I'm going to suggest without invitation: check out JSONIX.
d
Ya, I tried that but it was difficulty to work with and include in the project. The post I'm thinking over was a single custom function.
How are you using it and able to include in your NetSuite project?
s
Ah. Well, if you lower your expectations in terms of functionality and reliability then a single-function stack overflow answer may fit nicely :)
I (preferalbly) generate the JSONIX mapping using the little java utility that you feed XSD
I did have to tweak things a bit to get it all working in SS2.1, but not long ago used it for calling a SOAP web service and went quite nicely
d
Can it run server side?
s
Yes, my case was a MR script IIRC
There's also more lightweight (in terms of complexity and capabilities) libs you could try xml2js or similar.
d
I can't even get the JSONIX mapping to work
b
xml2js and xml-js are options if you are willing to use a bundler like browserify