My requirement is to create a subset of json. I'm planning to use JSLT for this transformation. Since the attributes will only be known at the run time, I need to generate JSLT on the fly (based on the attribute selection). But the problem is that the JSLT is not a valid JSON (the value is not escaped with double quotes).
Is there a recommended way to generate JSLT ? Thanks in advance.
Hi Team,
My requirement is to create a subset of json. I'm planning to use JSLT for this transformation. Since the attributes will only be known at the run time, I need to generate JSLT on the fly (based on the attribute selection). But the problem is that the JSLT is not a valid JSON (the value is not escaped with double quotes).
Is there a recommended way to generate JSLT ? Thanks in advance.
Example:
Input Json:
{ "basicInfo": { "businessId": "B123" }, "managementFees": { "rate": 20 } }
User selected Attribute
"$.basicInfo.businessId"
JSLT to be generated :
{ "basicInfo":{ "businessId":.basicInfo.businessId} }
Json subset after JSLT transformation:
{ "basicInfo": { "businessId": "B123" } }