0

现在我有一个本地文件,就像:

<userCode>001</userCode><productCode>001</productCode><Fee>1.00</Fee>
<userCode>002</userCode><productCode>002</productCode><Fee>2.00</Fee>
<userCode>003</userCode><productCode>003</productCode><Fee>3.00</Fee>;

我需要将此文件转换为:

<Fee>1.00</Fee><productCode>001</productCode>
<Fee>2.00</Fee><productCode>002</productCode>
<Fee>3.00</Fee><productCode>003</productCode>

我想我需要先阅读,然后再写作。如何在 WSO2 中做到这一点?

4

1 回答 1

1

我希望你有一个包装这些数据的顶级元素。使其成为适当的 xml。前任 :

    <data><userCode>001</userCode><productCode>001</productCode><Fee>1.00</Fee>... </data>

脚步

1)在axis2.xml中配置VFS传输发送者和接收者

2)为您的内容类型使用 ApplicationXML 消息生成器和格式化程序(这可以是任何前:文件/xml)

3) 配置 VFS 代理以在给定目录中侦听此内容类型。

4) 当消息到来时,使用 XSLT 中介进行转换

5) 使用 VFS sender 存储转换后的文件。

谢谢, 慈善机构

于 2012-05-22T05:28:29.800 回答