# do-set-local-variable

The <do-set-local-variable> action causes a local variable with the given name to be set to the string value specified by <arg-string>, the XPATH 1.0 Node Set specified by <arg-node-set>, or the Java Object specified by <arg-object>.

### Examples

>     <do-set-local-variable name="lastName" scope="policy">
>       <arg-string>
>         <token-attr name="Surname"/>
>       </arg-string>
>     </do-set-local-variable>

>     <do-set-local-variable name="lastName" scope="policy">
>       <arg-node-set>
>         <token-attr name="Surname"/>
>       </arg-node-set>
>     </do-set-local-variable>

>     <do-set-local-variable name="lastName">
>       <arg-object>
>         <token-xpath expression="jrandom:new()"/>
>       </arg-object>
>     </do-set-local-variable>

## 1. Allowed Content

> arg-string
>   string argument
> arg-node-set
>   node set argument
> arg-object
>   Java Object argument

## 2. Attributes

> Attribute | Value(s) | Default Value
> --- | --- | ---
> disabled | true | false true if this element is disabled | false
> name | CDATA name of the variable supports variable expansion after expansion, must be a legal XML Name | #REQUIRED
> notrace | true | false true if this element should not be traced during execution of policy | false
> scope | policy | driver scope of the variable policy - variable is visible only within the current policy during the current invocation of the policy driver - variable is visible to all policies within the current driver until the driver is stopped supports variable expansion | policy

## 3. Content Rule

> ( arg-string | arg-node-set | arg-object )

## 4. Parent Elements

> actions
>   actions that are performed by a <rule>
> arg-actions
>   actions argument

Top Elements || All Elements || Tree