2.5. Actions and options

Actions are parts of the script where we can describe what to do in different situations. Each situation in the script has a name - like “finally”, “init”, “onAbsence”, “onExcess” etc. The situations after the value type validation are called “onTrue” and “onFalse” etc. The important action is “forget” which enables to process sequentially very large XML source data, which are bigger than the memory of the computer - after the processing of the element the memory with processed data is released.

The list of options is recorded in the script in a special section called “options”.

<Person xd:script = "finally out('Person was processed';
                     forget; options trimAttr, trimText);" >
  firstname   = "optional string(2,30); onFalse myError(1);"
  familyname  = "required string(2,30); options setAttrUpperCase;"/>