Forum Discussion

pavia's avatar
pavia
New Contributor II
2 years ago
Solved

Formatting CSV data for XML output

First time trying to format into XML with SnapLogic. I have CSV data that I am trying to convert into XML. There are repeating elements, possibly multiple, in the schema.  I've pared down the schema...
  • endor_force's avatar
    endor_force
    2 years ago

    It relies on that the data input to the xml generator contains the relationships as you intend to have them related in the xml structure.
    Then in the xml generator you would be able to generate output based on that structure using a for each loop for child relations in a list. 

    Attached is a new sample which groups data twice, first by employee to create dependencies and then one common large group in order to be able to have all records in one common xml file out.
    I have two foreach loop, one for each employee and then one for each dependent record.

    Here is some reference and sample of the Velocity syntax: Apache Velocity Engine - User Guide