在Datapower上下文中设置动态可变参数

问题描述

| 我的要求是在for循环中为数据能力上下文设置一些动态变量,例如:
<dp:set-variable name=\"\'var://context/txn-info/appErrorInd[$i+1]\'\"
                value=\"\'yes\'\" />
变量$ i将继续变化。上面的代码不起作用。有人可以给我解决办法吗?     

解决方法

采用:
<dp:set-variable name=\"\'var:{//context/txn-info/appErrorInd[$i+1]}\'\"
                 value=\"\'yes\'\" />
以上是对提供的代码的机械更正。它很可能包含另一个更细微的错误。同样也要纠正此错误,请使用:
<dp:set-variable name=\"\'var:{(//context/txn-info/appErrorInd)[$i+1]}\'\"
                 value=\"\'yes\'\" />
说明: 使用AVT。
[]
运算符的优先级高于the4ѭ伪运算符。要覆盖这一点,需要使用明确的括号。     

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...