[英]How to use xpath xpression for multiple condtions to check if data is present or not in wso2 ESB?
[英]How to use xpath xpression to check if data is present or not in wso2 ESB?
我已經在一個屬性中捕獲了我的輸入ID,現在我想驗證該屬性是否有數據。 這個怎么做? 我做了這樣的事情:
這是我設置的屬性:
<property xmlns:cct="http://www.tempuri.org/" name="ID" expression="//cct:ID" scope="default" type="STRING"/>
這是我的xpath表達式,應該驗證屬性是否有數據:
count(get-property(ID)[text()])>0
但是這個表達是錯誤的。 如何解決這個問題。 請幫忙。 提前致謝
將您的屬性更改為此:
<property xmlns:cct="http://www.tempuri.org/" name="ID" expression="//cct:ID/text()" scope="default" type="STRING"/>
然后使用
boolean(get-property('ID'))
應該是下面的樣子
count(/property[@name='ID']/text())
請注意,正確的路徑(而不是/ property / ..)取決於您的xml。 如果不確定路徑,也可以使用/ * / property /...。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.