有人可以举例说明如何在m子中将csv转换为xml吗? [英] Can someone give example how to convert csv to xml in mule?

查看:63
本文介绍了有人可以举例说明如何在m子中将csv转换为xml吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是M子的新手.

我想做下面的事情

1) Read csv file from local drive
2) Transform to xml
3) Write xml

请帮助.

推荐答案

将CSV转换并映射到XML的最简单方法之一是使用Mule Datamapper https://developer.mulesoft.com/docs/display/current/Datamapper + User + Guide + and + Reference

One of the easiest way to convert and map a CSV to XML is use of Mule Datamapper https://developer.mulesoft.com/docs/display/current/Datamapper+User+Guide+and+Reference

但是,此 Datamapper 是Mule 企业版版本的功能...

But, this Datamapper is a feature of Mule enterprise edition...

其他替代选择是

  1. 使用文件入站终结点从本地光盘加载 CSV 文件

使用 expression-transformer 将有效负载拆分到每一列中,将每一列存储在 flow变量中,参考:- 如何读取CSV文件并使用Mule ESB,Mule Studio将数据插入PostgreSQL

using expression-transformer to split the payload into each column, store each column in a flow variable, ref :- How to read CSV file and insert data into PostgreSQL using Mule ESB, Mule Studio

,最后使用 XSLT 创建以流变量作为输入的 XML 有效负载.ref:-

and finally use XSLT to create XML payload with flow variables as input .. ref :- https://developer.mulesoft.com/docs/display/current/XSLT+Transformer

此外,您还可以引用以下链接:-

In addition, you can also refer following links :- http://opendevelopmentnotes.blogspot.in/2013/09/mule-esb-csv-to-xml-conversion.html

csv到xml:不确定在Mule ESB中执行此操作的最佳方法

这篇关于有人可以举例说明如何在m子中将csv转换为xml吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆