Reputation: 1225
I have captured my input id in a property and now i want to validate if the property has data or not. How to do this? I have done something like this:
This is my property that i have set:
<property xmlns:cct="http://www.tempuri.org/" name="ID" expression="//cct:ID" scope="default" type="STRING"/>
This is my xpath xpression that should validate if property has data or not:
count(get-property(ID)[text()])>0
But this expression is wrong. How to solve this. Please help. Thanks in advance
Upvotes: 2
Views: 4452
Reputation: 163
Change your property to this:
<property xmlns:cct="http://www.tempuri.org/" name="ID" expression="//cct:ID/text()" scope="default" type="STRING"/>
then test using
boolean(get-property('ID'))
Upvotes: 6
Reputation: 2747
It should be something like below,
count(/property[@name='ID']/text())
Note that the correct path (instead of /property/..) depends on your xml. you may also use /*/property/... if not sure about the path.
Upvotes: 0