Setting a variable
In USoft Blend, you can use the following assignment directives to create a named variable and set it to a value.
As you can see, each variable you create is explicitly typed. Each of the available assignment directives maps to one of the 4 XSLT data types.
In practice, most Blend scripts are simple utilities that do not require strong typing. You should regard pc:assign-string as the default for Blend variables. Occasionally it is important to be able to accept a node set value as a node set and not as a string value. Also, occasionally, you want to calculate with number values (as in $portnumber + 1), in which case you must cast to the number type and not to the string type.
Each assignment directive has a ...-default counterpart. Use this counterpart if you want to set the value only if the variable is not already known (with an existing value). In other words, use the ...-default counterparts if you want to prevent overwrites.
Other directives and attributes relating to variable assignment include:
Getting a variable
You can get the value of an instantiated variable by using the standard XSLT variable reference syntax:
This example outputs a string value:
This example outputs a node set value: