在xpath表达式中使用mule变量值 [英] using mule variable value in xpath expression

查看:132
本文介绍了在xpath表达式中使用mule变量值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < set-variable variableName =productIdvarvalue =#[xpath: // productId]doc:name =Variable/> 

在正确登录后,



我想在我的xpath表达式中使用变量productIdvar的值,

 <当expression =// * [local -name()= '为itemid'] =?评价者= 的xpath > 

 < when expression =#[xpath:// * [local-name()='itemid'] =?]> 



我应该使用什么的?获取变量的值?



感谢
Rahul。

解决方案

以下表达式适用于您。

 <当expression =#[xpath('// * [local-name()= \'itemid\']')。text == productIdvar]> 

这样就可以将xpath的结果与productIdVar变量进行比较。 / p>

希望这有帮助。


I have a variable set as

<set-variable variableName="productIdvar" value="#[xpath://productId]" doc:name="Variable" />

On logging its coming right,

I want to use the value of the variable productIdvar in my xpath expression,

<when expression="//*[local-name()='itemid']=?" evaluator="xpath">

or

<when expression="#[xpath://*[local-name()='itemid']=?]">

What should i use in place of ? to get the value of the variable?

Thanks Rahul.

解决方案

The following expression should work for you.

<when expression="#[xpath('//*[local-name()=\'itemid\']').text == productIdvar ]">

This way you should be able to compare the result of the xpath with the "productIdVar" variable.

Hope this helps.

这篇关于在xpath表达式中使用mule变量值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆