npsobj modifyvar append

Syntax

npsobj_modifyvar_append ::=

  <npsobj modifyvar = "append" 
    varname = "name" 
    name = "varValueKey"
    [ local = "( true | false )" ] />

Task

First, this element checks whether the export variable name exists and whether it is a context list. An error is generated if the variable exists and is no context list. If the variable does not exist, it is created as an empty context list. To the list, another list is appended, namely the list resulting from the evaluation of varValueKey.

If the attribute local, which is available from version 6.7.1, is specified and its value is true, and if the export variable does not yet exist, it will be created as a local variable. This will restrict its scope to the current layout file, meaning that it is neither visible in the calling layout nor in sublayouts. Use unique names for variables or a modifyvar-set instruction with local scope prior to modifyvar append to ensure that the variable is local. Please note, that from version 6.7.1, variables can be passed to layouts included by means of insertvalue-template instructions.

To the export variable a link context list as well as a file context list can be appended, independently of the contexts stored in the export variable. If the resulting list potentially contains link contexts as well as file contexts, your NPSOBJ code should differentiate between these two cases by querying a field that only exists for files and is never empty, e.g. objClass. If the check results in an empty value, then the context must be a link context.

Example

<npsobj modifyvar="append" varname="mixedList" name="freelinks2" />
<npsobj list="mixedList">
  <npsobj condition="isEmpty" name="objClass">
    <!-- Must be link context -->
  </npsobj>
  <npsobj condition="isNotEmpty" name="objClass">
    <!-- Must be file context -->
  </npsobj>
</npsobj>