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



成功

如何在 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

最新更新