As almost every scripting language, XSH2 supports subroutines, various conditional statements, loops and even exceptions.
single XSH2 command or a block of XSH2 commands
indirect call to a user-defined routine (macro)
sub-routine declaration
execute a given block of commands
evaluate given expression as XSH commands
exit XSH2 shell
loop iterating over a node-list or a perl array
if statement
conditionally include another XSH2 source in current position
include another XSH2 source in current position
iterate a block over current subtree
immediately exit an enclosing loop
start the next iteration of an enclosing loop
restart an iteration on a previous node
restart the innermost enclosing loop block
return from a subroutine
switch into normal execution mode (quit test-mode)
process selected elements from an XML stream (EXPERIMENTAL)
do not execute any command, only check the syntax
throw an exception
try/catch statement
undefine sub-routine or variable
negated if statement
simple while loop