Support Questions

Find answers, ask questions, and share your expertise

NESTED XML to CSV file

New Contributor

Hi Guys,

We have nested xml; which need to translated to csv and we do not have XSLT for the data; We have XSD but not sure is it useful or not.

<levels>
<object>
<id></id>
...
<subobject1>
<id></id>
...
</subobject1>
</object>
<object>
<id></id>
...
<subobject1>
<id></id>
...
<subobject2>
<id></id>
...
</subobject2>
</subobject1>
</object>
</levels>

Regards,

Navin

1 REPLY 1

XML is a complex format as it is a tree structure, but with a XSD it is possible to safely convert the XML file.

But XSD files also supports various formats with makes it a bit more complicated.

Any how I wrote a few articles about this topic a few weeks ago and also published source code for doing the conversion.

Here is a few direct links that might be useful for you.

XML2CSV git repo nifi-xml

XML2CSV article XML to tables (xml2csv) with NiFi and Groovy Part 2 of 2

If you also is interested in avro forma have a look at this

XML2Avro git repo xml2avro

XML2Avro article XML2Avro NiFi processor

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.