mule - 加载 xml 文件后更新值
问题描述
我正在使用readUrl
命令加载以下 xml 文件
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<a>
<b>xyz</b>
<c>
<d>false</d>
<e>false</e>
<f>true</f>
</c>
</a>
</soapenv:Body>
</soapenv:Envelope>
在与 readUrl 命令相同的数据编织中 - 我想将 xmle
值更新false
为true
有人可以帮忙吗
干杯,
强尼
解决方案
使用 Mule 4.3.0 中可用的更新运算符可用于根据需要更新值:
%dw 2.0
output application/xml
ns soapenv http://schemas.xmlsoap.org/soap/envelope/
var soapMessage=readUrl("...","application/xml")
---
soapMessage update {
case .soapenv#Envelope.soapenv#Body.a.c.e -> true
}
推荐阅读
- java - 如何将参数标记动态传递给 JSTL 查询?
- c# - 如何在 C# 中使用 XML Tree 的可用结构构建 XML Tree
- autodesk-forge - BIM360 Forge API topFolders 端点
- python - 如何在非 django-project 中使用 django orm?
- mysql - mysql过程if条件
- pixi.js - 在画布上制作缩放图像幻灯片
- javascript - VueJs 理解 v-model 和 v-on:click
- javascript - 为什么 .simulate("mouseover") 在 Jest / Enzyme 测试中不起作用?
- reactjs - 努力从api获取一些数据
- java - Kotlin 到 java 的转换 DefaultConstructorMarker 在 kotlin.jvm.internal 中不公开