Logic Nodes

Script Node

A script node allows the user to define an Expression to be evaluated at that point in the grammar. The Expression must be entered as text between opening and closing Script Nodes, as shown below:

<Script>$complete = if($count == 10, 1, 0)</Script>


A CDATA tag must be used if the Expression includes any characters which could be interpreted as XML (e.g. a < sign), as shown below:

<Script>
  <![CDATA[ 
  $complete = if($count < 10, 1, 0)
  ]]>
</Script>


Dollar variables in an Expression may refer to preceding Attribute Nodes, now assigned values read from the file, providing that these Attribute Nodes have been declared as script variables in the scriptVariables attributes of ancestor nodes (in each case, an ancestor node of both the Attribute Node, and the current Script Node). Dollar variables referring to Attribute Nodes in this way must be in the form $scope_attributeName, where scope is the name of the node that the script variable was declared on.

A Script Node has no attributes other than the common attributes.

A Script Node should not contain any child nodes. Any child nodes of a Script Node will be ignored.

Validate Node

A Validate Node is the same as a Script Node, except that a Validate Node will only be run if the Validate File Format box is ticked in the File Format Description tab of the File Collector configuration form.