emerson
emerson

Reputation: 95

How to parse XML to JSON in Apache Nifi

I am starting using Apache Nifi and I have several XML files with different structures to extract fields and later call some APIs enrich and after convert to JSON and POST in different APIs.

Are there any references about which components to use?

Upvotes: 1

Views: 899

Answers (2)

emerson
emerson

Reputation: 95

As reference for those are starting in Nifi, like me. This nice post https://dev.to/tspannhw/processing-fixed-width-and-complex-files-58i7 contains pretty much or maybe all processors can be used for file manipulation.

Upvotes: 0

Mike R
Mike R

Reputation: 589

I would recommend using the ConvertRecord Processor to convert the XML to JSON ConvertRecord Processor. I am not the most familiar with using it for XML, but have used it for converting CSV to JSON and it works flawlessly. Just make sure to configure the XMLReader service accordingly. XML Reader

I am not sure about everything else you're trying to do, but this will help with the XML conversion to JSON.

Upvotes: 1

Related Questions