You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Group By with a CSV

edited Sep 12, 2019 8:56PM in Integration 3 comments

Summary

I want to group by an element in a csv to create dependecy tree

Content

This is possible with XSLT, but seems quite difficutl to this with OIC, here is another example in stackoverflow
https://stackoverflow.com/questions/2146648/how-to-apply-group-by-on-xslt-elements

 

CSV
item dependency
ItemA DependencyA
ItemA DependencyB
ItemA DependencyD
ItemB DependencyA
ItemB DependencyB
ItemB DependencyC
ItemC DependencyC
ItemC DependencyE

 

The above table is the input CSV

It will output the following XML in oic:

<name>
    <nameset>
        <item>ItemA</item>
        <dependency>DependencyA</dependency>
    </nameset>
    <nameset>
        <item>ItemA</item>
        <dependency>DependencyB</dependency>
    </nameset>
    <nameset>
        <item>ItemA</item>
        <dependency>DependencyD</dependency>
    </nameset>
    <nameset>
        <item>ItemB</item>
        <dependency>DependencyA</dependency>
    </nameset>
   

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!