Is there a way to treat the hierarchy of the XML in such a way that can result in all of the data rolling up under the top level as a single row of data?
In a simple case, using the “Fill down” action should do the trick. However, if the structure of XML is not consistent, a more complicated method can be used. In the example below, I provided 2 methods how to flatten the XML you provided.
Problem at solution
above (flatten-xml) is if you have more than one occurence (1:n, Loops …) in der XML. In this case only the first occurrence is taken. Would be great if Easymorph could work on XSDs
@dgudkov - thank you! This is perfect and worked great when applied to the full XML file/format we’re working from. Separately, we’ve learned that the originating process for this file will potentially produce multiple files (each XML file representing a customer order), that would be delivered to us in a consistent directory location. If using the scheduler to process, is the best option to use the “List Files” action and then have it process with some conditions (specific file name, or when list is not empty…) to churn through the source files and process each ?
The idiomatic way to process multiple uniform files in EasyMorph is to use iterations (loops). Check out our tutorial on iterations here: EasyMorph | Iterations
Alternatively, you can use the “List files” action to produce a list of files in a specific location, then filter it (if necessary) using a filtering action in EasyMorph, then use the “Import from XML” action in the “Load multiple files” mode. The mode is described in this tutorial article (see the Advanced topics): EasyMorph | Loading files
If you choose to process multiple files at once, instead of iterations, you may need to adjust the logic in the example that I posted above because they are designed to work for one transmission (order). You may need to add grouping by file name so that operations are performed inside groups.