如何在 mulesoft 的 dwl 2.0 中的 xml header 标签中定义多个命名空间?

How to define multiple namespace in xml header tag in dwl 2.0 in mulesoft?

成功

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

您的意思是只在 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