【问题标题】:is there any way to convert xml to json with out using java code in mule esb?有什么方法可以将 xml 转换为 json 而无需在 mule esb 中使用 java 代码?
【发布时间】:2014-07-30 22:02:53
【问题描述】:

我可以使用以下链接使用 java 代码将 xml 转换为 json, Mule: Is there simple way of converting XML to JSON

但我的要求是 n 个 xml 文件必须在不使用 java 类的情况下转换一种 json 格式,怎么做?你能帮我吗?

【问题讨论】:

    标签: xml json mule


    【解决方案1】:

    您可以使用 Smooks 在最常见的数据格式之间进行转换。看看这个例子:http://pragmaticintegrator.wordpress.com/2010/04/29/using-smooksmule-to-transform-csv-file-to-xml-one/

    【讨论】:

      【解决方案2】:

      只需在 Mule 中使用 XML To Json Transformer ...请阅读此文档:- http://www.mulesoft.org/documentation/display/current/Transformers

      标签有点像这样:- <json:xml-to-json-transformer doc:name="XmlToJson"> 在你的 mule 配置中

      【讨论】:

        【解决方案3】:

        对于您不关心架构的自动转换,您可以使用 xml 到 json 转换器。对于更精细的控制,Mule Studio 中的 DataMapper 提供了一种图形方式来指定从 XML 到 JSON 的转换,反之亦然。它完全支持检测消息的 Schema,并在必要时使用 Mule 表达式实现更复杂的转换规则。

        http://www.mulesoft.org/documentation/display/current/Datamapper+User+Guide+and+Reference

        【讨论】:

          猜你喜欢
          • 2015-09-16
          • 1970-01-01
          • 2020-09-14
          • 1970-01-01
          • 1970-01-01
          • 2014-01-10
          • 1970-01-01
          • 2023-03-16
          • 1970-01-01
          相关资源
          最近更新 更多