3.4 Using Variables in XML

The text within an XML tag can refer to a variable. To do so, use the following notation:

$(MY_VARIABLE)

For example:

<element>
    <name>The name is $(MY_NAME)</name>
    <value>The value is $(MY_VALUE)</value>
</element>

When the XML parser parses the above tags, it will replace the references to variables with their actual values as follows:

  1. First, it will try to get the variable value from the command-line. The variable value can be provided using the -var command-line option (see Table 4.1 RTI Queuing Service Command-Line Options)
  2. If the value is not found, the parser will try to get it from the OS environment variables.
  3. If the value still cannot be found, the parsing process will fail.