Function context is an equivalent to Python stack frame. This allows functions to have local variables that are visible only to the function XML body.
Function context may be considered as a key-value storage. If a key does not exist in current context then parent context is searched for the key.
Data may be published to function context using ordinary <set/>
function by using path in a form of "#key":
<set path="#myKey">value</set>
sets "myKey" function context value to "value".
This value may be later accessed in inner block using select:
<select path="#myKey"/>
Values is function context may be not just scalars but a whole objects:
<set path="#myKey"><select/><set/>
sets myKey local variable to an object pointed by current cursor position. Because this is a reference to a model part rather than its copy if ones edits its content the changes will be also present in original Model.
To edit content of local variable (eg. value in function context) "target" argument of <set/>
function is used: <set path="property" target="myKey">value</set>
. Because target always denotes a key in function context there is no need for # sign.
Function context values may also be the source for the <select/>
and other selection functions:
<select path="property" source="myKey"/>