Example 1: Using Specific Blocks of HTML Code Depending on Conditions

The example below demonstrates how to display user name and logout option taken from the original page if user is logged in and display login option otherwise:

<div class="user">
       <!--{if X.test('//a[.="Logout"]') }-->
         <span>

                 <!--{= X.value('id("top")//td[@class="user-name"]') }-->
         </span>

         <a>">Logout</a>

      <!--{else}-->

         <a>">Login</a>

      <!--{/if}-->
</div>