Closed Jacksonericd closed 8 months ago
OK thanks, I'll have a look at this.
Could you supply the input XML as text rather than an image, thanks.
Could you supply the input XML as text rather than an image, thanks.
Please find the input XML :
This is because the implementation of the Parker transform in this package has always done this, if you look at the test strings -
String complexXmlTestString =
...
'<report_id>637619</report_id>'
....
and the corresponding expected json -
String parkerComplexJsonCheckString = '{'
...
'"report_id":"637619",'
...
you can see that the integer value of report id is quoted which is what you are seeing.
The original Parker transform algorithm I based this on back in 2013 is unfortunately lost in time however it has been like this since then. I don't want to change this as it will break expected behaviour for many users.
A better approach would be to add another Parker transform like the toParkerWithAttributes transform named toParkerModern or something similar but this would take more time.
This is the XML i am trying to parse into json :
And the expected output is :
{ "Result": { "ErrorNo": 0, "Message": "Success", "Rows": { "R": [ { "C": [ { "FA": 1, "SA": 0, "RE": 1 }, 19072023011, "Hiragappa shivappa Naduvinaker", 600, "SUGAR PACKING 1KG POUCH,SUGAR PACK", "RTGS", 3000, "-", 10010000122, "KVGB0003211", "23/08/2023", "KARIBASAPPA B C", "10,000.00 Dr", 89113391461, "CA", "", "Pending", "" ] }, { "C": [ { "FA": 1, "SA": 0, "RE": 1 }, 19072023012, "MSM Services", 650, "CATRIDGE REFILL AND DRUM 2NOS", "Internal", 3000, "-", 10010000123, "ICIC0002815", "23/08/2023", "SHIVALEELA B S", "30,000.00 Dr", 12458689521, "CA", "", "Pending", "" ] } ] } } }
But it returned :
{ "Result": { "ErrorNo": "0", "Message": "Success", "Rows": { "R": [ { "C": [ "19072023011", "Hiragappa shivappa Naduvinaker", "600", "SUGAR PACKING 1KG POUCH,SUGAR PACK", "RTGS", "3000", "-", "00010010000122", "KVGB0003211", "23/08/2023", "KARIBASAPPA B C", "10,000.00 Dr", "89113391461", "CA", "", "Pending", "" ] }, { "C": [ "19072023012", "MSM Services", "650", "CATRIDGE REFILL AND DRUM 2NOS", "Internal", "3000", "-", "00010010000123", "ICIC0002815", "23/08/2023", "SHIVALEELA B S", "30,000.00 Dr", "12458689521", "CA", "", "Pending", "" ] } ] } } }
I lost the first value inside the List 'C' . (Eg: { "FA": 1, "SA": 0, "RE": 1 }, )