XML : Converting json response to XML using XSLT

I am calling a rest service in xslt and in return getting JSON response .

How can i extract data from that JSON response using XSLT.Below is the XSLT code for calling the rest service and also given the JSON response. From JSON response i need to extract the values of Cookie1.Cookie2 and Cookie3.

  <xsl:variable name="result1">   <dp:url-open target="{$abc}" response="binaryNode" resolve-mode="xml" data-type="xml" http-method="post">  </dp:url-open>  </xsl:variable>    <xsl:variable name="json">  <xsl:value-of select="dp:decode( dp:binary-encode($result1/result/binary/node()), 'base-64' )" />  </xsl:variable>    

==============

JSON Response:
{"mapData": { "Cookie1": "KlzpP965iBw==", "status": "True", "Cookie2": "DDGT8mcsuzdMNNQ=", "Cookie3": "VERSION_4~mPpYUDcZnoJ0Z" }}

Please let me know how to do this using XSL.

No comments:

Post a Comment