Support Questions
Find answers, ask questions, and share your expertise

How to parse xml array and convert to csv?

New Contributor

Hello All.

 

I am trying to convert the xml file resulting from API call to csv and save it in S3 object stroage.
XML with single array structure can be saved after converting csv to the flowfile configured below. But now the xml result I want to convert to csv is a multi array, so only the first array that is the result of calling api is parsed, and all the fields under <item> that I really need are stored in one field.

flowfilesflowfiles

updateattributeupdateattribute

invokehttpinvokehttp

convertrecordconvertrecord

controller xmlreadercontroller xmlreader

controller csvwritercontroller csvwriter

When the flowfile is configured in this way, the result of executing the convertrecord processor for the xml result of api is as follows.

 

api result  xmlapi result xmlafter concertrecord to csvafter concertrecord to csv

 

I only want to save the result of originallink, link, description, description, title, pubDate under MapRecord in csv. Please tell me how. 

 

In addition, I attach the configuration to avroregistry.

avroregistryavroregistryavroregistry schemaavroregistry schema

 

 

 

0 REPLIES 0