What is the easy way to parse an XML In a stored Proc/SQLRPGLE ? Can I use XSLT in Iseries ?

Viewed 300

I have a Stored procedure which receives input as XML. What I need to do it to create the XML into another form which is Suitable for Another system(with the data from the input XML)

I figured out 2 options to do this but both are laborious. 1. Create a DS in the form of the XML and do a 'XML-INTO' to parse data. Then create the new XML 2. Use XMLTABLE to parse out the data.

Is there a easier way to create the new XML. A senior in my team suggested to use XSLT. Is this possible in the i?

1 Answers

XSLT should be available, if nothing else, the IBM i has node.js available and a quick search turned up an XSLT package for node.

Not sure why you find XMLTABLE laborious...and given that it shares the same functions with XSLT, I'd imagine XSLT wouldn't be any better.

You also forgot one option, RPG IV offers the XML-SAX op-code also; which obviously uses a SAX parser vs the DOM parser of XML-INTO.

With more information about the document, and how you need to pass off the data, we could probably offer more guidance.

Related