企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# XML报文 ## **概述** XML报文规则遵循XML语法规范,例如如下XML报文: ``` <pre class="calibre29">``` <span class="token"><</span><span class="token">?</span>xml version<span class="token">=</span><span class="token3">"1.0"</span> encoding<span class="token">=</span><span class="token3">"GBK"</span><span class="token">?</span><span class="token">></span> <span class="token"><</span>A<span class="token">></span> <span class="token"><</span>fieldname1<span class="token">></span><span class="token">--</span><span class="token">-</span> this is fixed content<span class="token"><</span><span class="token">/</span>fieldname1<span class="token">></span> <span class="token"><</span>B<span class="token">></span> <span class="token"><</span>transcode<span class="token">></span><span class="token2">2000</span><span class="token"><</span><span class="token">/</span>transcode<span class="token">></span> <span class="token"><</span>fixedfieldname2<span class="token">></span><span class="token2">2</span><span class="token"><</span><span class="token">/</span>fixedfieldname2<span class="token">></span> <span class="token"><</span><span class="token">/</span>B<span class="token">></span> <span class="token"><</span><span class="token">/</span>A<span class="token">></span> ``` ``` XML报文是根据路径进行解析的,例如我们要访问交易码信息,那么我们访问的路径xpath为:/A/B/transcode ## **配置** ![](https://img.kancloud.cn/c8/7e/c87ed49fc363153b18dca525b113d3f9_1436x696.png) 1. XML报文配置中“xpath”为“/”时表示解包常量,以“/”开始的节点表示使用绝对路径解包或组包XML,否则视为使用相对路径(即相对上级节点配置的路径)。XML中若需要获取属性值则XPATH需配置为XPATH/@属性名。 2. XML报文解包或组循环报文的循环次数由XPATH或上下文LIST中的记录数决定