<case>
[<if condition="expression">
if body
</if>] *
[<else>
else body
</else>]
</case>
| Name | Required | Default | Description |
|---|---|---|---|
| condition | yes |
If true (yes), body of if is evaluated.
|
<var-def name="contact">
<xpath expression="//a[contains(., 'contact')]/@href">
<var name="pageContent"/>
</xpath>
</var-def>
<var-def name="contactMail">
<case>
<if condition="${contact.toString() != ''}">
<var name="contact"/>
</if>
<else>
Contact is not defined!
</else>
</case>
</var-def>
Here, conditional processor is used to check if previous xpath search has found contact information on the page.