Five Stars

tExtractJsonFields error on json field extraction

Hi , I have a job as shown below

p3.png

The XML format is as follows

 

|200 |<?xml version="1.0" encoding="UTF-8"?>
<root><status>1</status><data>110.0</data></root>|null |

 

And the textractjsonfield configuration is as shown below. I want to capture the value of the <data> thats coming out of txmlmap

 

p4.png

 

When I run the job I get this error

p5.png

Any ideas on this?

5 REPLIES
Seven Stars

Re: tExtractJsonFields error on json field extraction

Hi,

 

Have you clicked on the "Code" tab in the bottom of the job design, next to "Designer" - look for the red section on the right had of the generated Java.

 

Thanks

 

David

Regards

David

Don't forget to give Kudos when an answer is helpful or the solution.
Five Stars

Re: tExtractJsonFields error on json field extraction

Hi David,

 

The red ones on the code are

 

XML_API_tXMLMap_1_TXMLMAP_OUT xml_api_tXMLMap_1_TXMLMAP_OUT = new XML_API_tXMLMap_1_TXMLMAP_OUT();

 


out3_tmp.data = treeNodeAPI_tXMLMap_1_TXMLMAP_OUT.get_String("row2.body:/root/data") treeNodeAPI_tXMLMap_1_TXMLMAP_OUT.get_String("row2.body:/root/data");


out3_tmp.status = treeNodeAPI_tXMLMap_1_TXMLMAP_OUT.get_String("row2.body:/root/status") treeNodeAPI_tXMLMap_1_TXMLMAP_OUT.get_String("row2.body:/root/status");allOutsForAggregate_tXMLMap_1.add(out3_tmp);

 

Can't get what's wrong here

Nine Stars

Re: tExtractJsonFields error on json field extraction

Hi,

 

Are you looking for the following output?

testXML1.PNGTestXML2.PNG

Regards,

Veeru Boppudi
Five Stars

Re: tExtractJsonFields error on json field extraction

Yes Veeru I am expecting this output

 

However, the output of my response is this way

 

200||<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ResponseStatus><data xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:decimal">110.00</data><status>1</status></ResponseStatus>

 

Can you please let me know how do I extract the value 110.00 from here?

 

Thanks

 

Nine Stars

Re: tExtractJsonFields error on json field extraction

Please try below

TestXML3.PNGTestXML4.PNG

Regards,

Veeru Boppudi