Search code examples
xmlxpathhiveapache-nifiingest

How can i pass all attributes from an xml to flowfile?


I have a nifi flow, that consists in introducing values from a xml into a hive table. I need to do that xml evaluation automatically because it has a lot of values.

Right now i'm doing that by introducing all the elements in the xml manually indicating the xpath of each element into evaluatexpath. Each element is passed as an attribute to AttributestoJSON.

What i want to achieve is to pass all elements from that xml as an attribute to AttributestoJSON automatically by reading all the components in the xml.


Solution

  • You likely want to look into a different approach using the ConvertRecord processor with an XML Reader service and a JSON Writer service. This should convert all of your XML into JSON.