How can I use XSLT Transformation in REST API

Hi,

I have a scenario, in which I need to accept JSON format request and convert into XML before sending to backend server. I was looking into XSLTransform  Policy. I plan to do a JSONToXML Convert policy to convert request object in XML and then use XSLTransform Policy.  Am I on the right track ?

Solved Solved
1 1 216
1 ACCEPTED SOLUTION

YES.

That's a fine way to do it. 

Alternatively, you can look at a JS policy to transform JS to "a differently shaped JS", and then use JSONToXML, to get the result you want.  This may help you avoid the XSLT, if you prefer to do it that way. 

Either way works. Some people like using XSL, some don't .  You have options. 

View solution in original post

1 REPLY 1

YES.

That's a fine way to do it. 

Alternatively, you can look at a JS policy to transform JS to "a differently shaped JS", and then use JSONToXML, to get the result you want.  This may help you avoid the XSLT, if you prefer to do it that way. 

Either way works. Some people like using XSL, some don't .  You have options.