简体   繁体   中英

mule datamapper xml to csv conversion

Below is my xml input:

<projects>
    <project>
        <name >project1</name> 
        <language>java</language> 
    </project>
    <project>
        <name>project2</name> 
        <language>mainframe</language>  
    </project>
</projects>

I want to convert this .xml to .csv file using data-mapper, but unfortunately it doesn't work.

Can anyone send me the sample flow xml for that? It is very important for my project now.

This is a very simple requirement. You should select your sample XML file in the input section of the datamapper and define a user defined output of type CSV. Once you create a mapping, map the fields from XML (input) to CSV (output). The code would like as below.

 //MEL //START -> DO NOT REMOVE output.__id = str2long(input.__id); //END -> DO NOT REMOVE output.name = input.name; output.language = input.language; 

You can now click on Preview button and run the preview with your sample XML file. Wasn't that easy? Try this and let me if any issues.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM