Overview

OCCP variables allow you to specify values that will be filled in when used in the rest of the Scenario File. Variables can be given values explicitly or be filled in via Generators. You may also specify xml CDATA as the value if it is required. Variables can also take on array forms.

Arrays hold multiple elements and are zero indexed so the first element is accessed with 0, the second with 1, and the Nth with N-1. One can access individual elements from the array or the entire array. The main motivation is to provide a way to pass large amounts of information to ContentPacks, particularly from Generators.

Declaration

Simple Variable

<var name="foo">qaz</var>

Array Variable

<var name="bar" type="array">
   <element>The first element</element>
   <element>The second</element>
   <element>The last</element>
</var>

Use

Simple Variable

${occp:foo}

Produces:

qaz

Array Variable

To access an individual element, in this case 0
${occp:bar[0]}

Produces:

The first element
To access all elements
${occp:bar[]}

Produces:

['The first element','The second','The last',]