<%@ page language="C#" masterpagefile="~/templates/Documentation.master" inherits="Page" pagetitle="IF Blocks" keywords="IF Blocks"%>

IF Blocks

IF blocks have a single input port, labeled condition; a Flow port; and two result ports: if then, and if else.

Figure 346. IF Block

You use IF blocks to compose if then, else XQuery expressions, such as the following:

		<Book> 
			{ 
				if( $book/title ) then 
					<Title/> 
				else 
					<ISBN/> 
			} 
		</Book> 

This expression, for example, was composed by mapping

IF blocks create a structure if the if then or if else branches are true. These ports can be connected to the target schema; otherwise they can be connected to Flow ports of FLWOR, function, and other IF blocks.