【发布时间】:2020-06-18 22:20:25
【问题描述】:
成功
如何在 dwl 2.0 中包含两个命名空间?
【问题讨论】:
-
我用@(xmlns#new:"xyz/wsdl/")解决了它
标签: xml mule dataweave mulesoft mule-esb
成功
如何在 dwl 2.0 中包含两个命名空间?
【问题讨论】:
标签: xml mule dataweave mulesoft mule-esb
你的意思是在一个 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
【讨论】: