Ritu

Ritu

  • 1.3k
  • 344
  • 37.5k

convert json to xslt

Aug 17 2021 7:19 AM

I have JSON and xml but I want to create xslt file using json.

from xml code how can xslt file is created.

JSON CODE:

{
  "?xml": {
    "@version": "1.0"
  },
  "request": {
    "control": {
      "senderid": "",
      "password": "",
      "controlid": "",
      "uniqueid": "false",
      "dtdversion": "3.0",
      "includewhitespace": "false"
    },
    "operation": {
      "authentication": {
        "sessionid": ""
      },
      "content": {
        "function": {
          "@controlid": "",
          "create_potransaction": {
            "transactiontype": "Purchase Order",
            "datecreated": {
              "year": "2021",
              "month": "8",
              "day": "18"
            },
            "vendorid": null,
            "referenceno": "Example - Spend Management",
            "vendordocno": "PO0085",
            "datedue": {
              "year": "2022",
              "month": "3",
              "day": "3"
            },
            "message": "test.. thru code",
            "returnto": {
              "contactname": "Lee, Wei"
            },
            "payto": {
              "contactname": "Lee, Wei"
            },
            "deliverto": {
              "contactname": "Lee, Wei"
            },
            "state": "Pending",
            "potransitems": {
              "potransitem": {
                "itemid": "1009--Lab Test Kits",
                "warehouseid": "200--200",
                "quantity": "8",
                "unit": "Each",
                "price": "500",
                "locationid": "200",
                "departmentid": "200"
              }
            }
          }
        }
      }
    }
  }
}

------------------------------------------------------------

XML CODE:

<?xml version="1.0"?>
<request>
    <control>
        <senderid></senderid>
        <password></password>
        <controlid></controlid>
        <uniqueid>false</uniqueid>
        <dtdversion>3.0</dtdversion>
        <includewhitespace>false</includewhitespace>
    </control>
    <operation>
        <authentication>
            <sessionid></sessionid>
        </authentication>
        <content>
            <function controlid="">
                <create_potransaction>
                    <transactiontype>Purchase Order</transactiontype>
                    <datecreated>
                        <year>2021</year>
                        <month>8</month>
                        <day>18</day>
                    </datecreated>
                    <vendorid />
                    <referenceno>Example - Spend Management</referenceno>
                    <vendordocno>PO0085</vendordocno>
                    <datedue>
                        <year>2022</year>
                        <month>3</month>
                        <day>3</day>
                    </datedue>
                    <message>test.. thru code</message>
                    <returnto>
                        <contactname>Lee, Wei</contactname>
                    </returnto>
                    <payto>
                        <contactname>Lee, Wei</contactname>
                    </payto>
                    <deliverto>
                        <contactname>Lee, Wei</contactname>
                    </deliverto>
                    <state>Pending</state>
                    <potransitems>
                        <potransitem>
                            <itemid>1009--Lab Test Kits</itemid>
                            <warehouseid>200--200</warehouseid>
                            <quantity>8</quantity>
                            <unit>Each</unit>
                            <price>500</price>
                            <locationid>200</locationid>
                            <departmentid>200</departmentid>
                        </potransitem>
                    </potransitems>
                </create_potransaction>
            </function>
        </content>
    </operation>
</request>


Answers (1)