CSV to XML trnformation using cloveretl

214 Views Asked by At

I want to transform my csv file to XML using cloveretl. I gone through the basic tutorial, all explains abound direct mapping from csv to xml, csv header column names are used for xml element name.

I have one complex XSD, and I want to map csv to that XSD generated xml. When I generate metadata using my XSD 213 fmt file generated in cloveretl.

How do map all these together ? I saw an option to map individually, one csv metadata to one fmt. Like this I have to do 213 mapping and combine all ?

1

There are 1 best solutions below

0
On

I assume you have two components: UniversalDataReader and XMLWriter. The edge between them should not have the metadata from the XSD schema (you do not have to extract metadata from the XSD at all), it should have metadata extracted from the input CSV file. Otherwise, you would not be able to read the file in the first place.

Then, in XMLWriter, you can set the XSD schema or create the mapping manually. For more information, see http://doc.cloveretl.com/documentation/UserGuide/topic/com.cloveretl.gui.docs/docs/extxmlwriter.html#xsd-mapping

If the CSV and the result XML are simple enough, you do not need the XSD schema at all.