【问题标题】:How to define multiple namespace in xml header tag in dwl 2.0 in mulesoft?如何在 mulesoft 的 dwl 2.0 的 xml 标头标记中定义多个命名空间?
【发布时间】:2020-06-18 22:20:25
【问题描述】:

成功

如何在 dwl 2.0 中包含两个命名空间?

【问题讨论】:

标签: xml mule dataweave mulesoft mule-esb


【解决方案1】:

你的意思是在一个 XML 输出中只使用两个 XML 命名空间?

%dw 2.0
output application/xml
ns orders http://www.acme.com/shemas/Orders
ns stores http://www.acme.com/shemas/Stores
---
root:
    orders#orders: {
        stores#shipNodeId: "SF01",
        stores#shipNodeId @(shipsVia:"LA01"): "NY03"
    }

输出:

<?xml version='1.0' encoding='UTF-8'?>
<root>
  <orders:orders xmlns:orders="http://www.acme.com/shemas/Orders">
    <stores:shipNodeId xmlns:stores="http://www.acme.com/shemas/Stores">SF01</stores:shipNodeId>
    <stores:shipNodeId xmlns:stores="http://www.acme.com/shemas/Stores" shipsVia="LA01">NY03</stores:shipNodeId>
  </orders:orders>
</root>

取自文档中的食谱:https://docs.mulesoft.com/mule-runtime/4.3/dataweave-cookbook-include-xml-namespaces

【讨论】:

    猜你喜欢
    • 2021-10-12
    • 2011-10-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 1970-01-01
    • 2014-04-19
    相关资源
    最近更新 更多