Layer7 API Management

  • 1.  Convert Db data(some format) into JSON

    Posted Feb 10, 2017 02:42 AM

    Hi All,

     

     I have a scenario like below. Please suggest me on this.

     

    I am able to connect to database for retrieving the data but I don't know which format (txt,xls,etc) it is. I am setting the variable and storing the data into this variable jdbc.xmlquery.

     

    We have data conversion like XML to JSON and vice versa.We can use XSL transformation to transfer the data what ever the format we required.

     

    My question here is Can we convert the data from XML to JSON thru XSLT in a single transformation.

     

    Please suggest me on this.

     

    Regards

    Rajasekhar



  • 2.  Re: Convert Db data(some format) into JSON

    Broadcom Employee
    Posted Feb 11, 2017 02:34 PM
      |   view attached

    Good afternoon,

     

    There is a built in assertion that will convert XML to JSON or vice versa (Apply JSON Transformation Assertion - CA API Gateway - 9.1 - CA Technologies Documentation ) which will not require a XSLT stylesheet to be used. If you want to use XSLT, I have attached a sample stylesheet that will convert XML to JSON.

     

    Sincerely,

     

    Stephen Hughes

    Director, CA Support

    Attachment(s)

    zip
    xmltojson.xsl.zip   1 KB 1 version