XPath Condition

XPath condition contains an XPath expression. To assign a template with such condition to page(s), Flamingo IDE analyzes page content, and, if the XPath expression is executed and returns TRUE, the template is assigned to this page.

In the Condition field , you should specify the XPath expression that should be executed on a page.

Example 1: Assign templates to pages where element with specified id exists

To assign templates to pages where element with the specified id is availabe, you can use the following code:

id('login-box')

Where id() is an XPath function. All pages containing element with the following attribute

id="login-box"

will be rendered using this template.

Example 2: Assign template to pages where specified DIV element is used

To assign template to all pages where DIV element of the notification class is used, you can apply the following code:

//div[@class='notification']

All pages containing

<div class="notification">...</div>

HTML code will be rendered using this template.