Variable references

Previous Next

 

 

 

USoft Blend borrows from XPath its $variable syntax for referring to variables. Once declared, a USoft Blend variable is global: it may be referred to from any later position in the Blend script.

Declaring Blend variables

You have a number of different syntax options for introducing USoft Blend variables. It is also possible to load variables from an external file. Here is just one example of the declaration of a Blend variable:

<pc:assign-var
     mypath="{path:GetFullPath(directories:Get())}" />

For an explanation of the curly braces in this example, go to Evaluated expressions vs. literals.

Referring to Blend variables

Here is just one example of how you can refer to the value of a variable called myvariable:

<pc:WriteFile filepath="{$myvariable}">Hello world</pc:WriteFile>

For an explanation of the curly braces in this example, go to Evaluated expressions vs. literals.

 

See also

Guide to expressions and data types

          Literal expressions

                  Dates

                  string literals

          Path expressions

          XML expressions

          XPath expressions

                 Node set expressions

                 Booleans

                 Strings

                 Numbers

                 Function calls

                 Variable references

                 Implicit XPath datatype conversion

                 Evaluated expressions vs. literals

          SQL expressions