XML Parsing in ServiceNow - Saxon / library / XMLDocument ??

Community Alums
Not applicable

Hi all,

I am trying to parse out a very large (3k - 5k lines typically) XML document within the platform and am wondering if anyone has experience with the best way to parse large, complex XML docs. The info will be going into several tables, upwards of 16 or so and I need to figure out a proper way to break all the data down so that I can identify and insert it into the tables. Is there support for Saxon or a recommended library, or is the ServiceNow XMLDocument fully capable of handling that type of content?

1 REPLY 1

Mike Patel
Tera Sage

I convert xml response to JSON which makes much easier to parse it.

var jsonObj = gs.xmlToJSON(res_body); // Converting XML into a JSON object

 Ref - https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0957116