Appendix A. Working With Variables - IBM WebSphere XS40 Command Reference Manual

Datapower xml security gateway
Table of Contents

Advertisement

Appendix A. Working with variables

Variables can be used in most context, except PIPE. To use a variable, you must
create it with the setvar action. A setvar action creates a variable in a specified
context and assigns it a value.
Note: You can view the value of variables for a transaction with the multistep
There are the following distinct variable types, each expressed in the var://URL
format:
var://local/variable
var://context/context/variable
© Copyright IBM Corp. 1999, 2008
probe. Edit the DataPower service to enable the multistep probe. After
enabling the multistep probe and recording transactions, you can view
variables and their values.
A local context variable to addresses a variable called variable in the default
(current) context. The following example transforms the document in the
tmp1 context with a style sheet that is referenced by the stylesheet-1
variable (also in the tmp1 context) and stores the transformed document in
the tmp2 context:
xform tmp1 var://local/stylesheet-1 tmp2
The local context does not persist beyond the scope of the multistep
transaction. A multistep transaction can include both a request component
and a response component. The local context cannot be accessed by any
object outside of the scope of the multistep transaction. In other words, the
service cannot read and use the variable.
A local context variables can be user-defined or based on an extension
variable. For a complete list of the available extension variables, refer to
"Extension variables" on page 992.
Addresses a variable called variable in a context called context. The
following example transforms the document in the tmp1 context with a
style sheet that is referenced by the stylesheet-1 variable (in the apple
context) and stores the transformed document in the tmp2 context:
xform tmp1 var://context/apple/stylesheet-1 tmp2
A named context does not persist beyond the scope of the multistep
transaction. A multistep transaction can include both a request component
and a response component. The local context cannot be accessed by any
object outside of the scope of the multistep transaction. In other words, the
service cannot read and use the variable.
Note: Creating variables in a named context is the recommended
approach. This form decouples the variable from the input and
output contexts and allows the variable to be accessed from any step
in a multistep scope.
A named context variables can be user-defined or based on an extension
variable. For a complete list of the available extension variables, refer to
"Extension variables" on page 992.
979

Advertisement

Table of Contents
loading

Table of Contents