HI,
I have a requirement where i need to convert XML 2 JSON which has numbers and i require some of them as number and some as string, currently all are converted as numbers or as string using <Options>.
please find example below
XML input:
<a:ItemResponse>
<a:Amount>1500.0400</a:Amount>
<a:xxxxxxx>3200027662909</a:xxxxxxx>
<a:RuleBreak>1</a:RuleBreak>
<a:RuleBreakData>
<a:StatusCode>
<a:Code>4</a:Code>
<a:Message>Item Decline.</a:Message>
</a:StatusCode>
</a:RuleBreakData>
<a:kkkkkkkk>685346587648678947698</a:kkkkkkkk>
</a:ItemResponse>
Expected outPut:
{
"ItemResponse": {
"Amount": 1500.04,
"xxxxxxx": "3200027662909",
"RuleBreak": 1,
"RuleBreakData": {
"StatusCode": {
"Code": "4",
"Message": "Item Decline."
}
},
"kkkkkkkk": "685346587648679000000"
}
}
Here Amount should be number and remaining shiuld be String, please let me know if there is a way to do this.