Hi,
I have built a webservice in SOA 12.1.3 from database, the response from the service can be XML or JSON. Some elements in the response could be null, so the XML response of the empty elements contains xsi:nil="true". When the response is in JSON, the empty elemets are {@nil:true}. I would like to convert the nil value in json to null like "NEXTDATE": {"@nil": "true"} to "NEXTDATE": null.
I am not familiar with Java, so any help with XQUERY or XSLT would be helpful.
sample XML response
<X_LINES_ITEM>
<ITEMCODE>0001-1000</ITEMCODE>
<ITEMDESCRIPTION>ItemDesc</ITEMDESCRIPTION>
<AVAILABLE>0</AVAILABLE>
<NEXTDATE xsi:nil="true"/>
<IMAGE xsi:nil="true"/>
</X_LINES_ITEM>
sample JSON response
X_LINES_ITEM": [
{
"ITEMCODE": "0001-1000",
"ITEMDESCRIPTION": "ItemDesc",
"AVAILABLE": 0,
"NEXTDATE": {
"@nil": "true"
},
"IMAGE": {
"@nil": "true"
},
},
Thanks,
Sri