简体   繁体   English

Mule Dataweave-将XML转换为具有多种对象类型的JSON列表

[英]Mule Dataweave - Converting XML to JSON List with Multiple Object types

I have to convert a XML payload to JSON. 我必须将XML有效负载转换为JSON。 The challenge here is the order of XML should not be changed while we convert it into JSON list of multiple type of objects ( Single JSON list has multiple object types). 这里的挑战是,当我们将XML转换为多种对象的JSON列表(单个JSON列表具有多种对象类型)时,不应更改XML的顺序。

The JSON will output in the order that you specify in your Dataweave transform. JSON将按照您在Dataweave转换中指定的顺序输出。 Just make sure that your output is in the order that you want and you should be fine. 只要确保您的输出按您想要的顺序排列就可以了。

First use https://codebeautify.org/xmltojson to convert your xml to json and save it in json format. 首先使用https://codebeautify.org/xmltojson将您的xml转换为json并将其保存为json格式。 now use this file as metadata. 现在将此文件用作元数据。 your xml will be convert same to json. 您的xml将被转换为json。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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