api:notnull

Version 22.0.8483


api:notnull

Version 22.0.8483


The api:notnull keyword checks that an attribute has a value in the specified item. The api:exists keyword is a synonym for api:notnull.

Parameters

  • item: The item to check. If not specified, the default output item is used.
  • attr: The name of the attribute to check.
  • action: The action to perform if the expression evaluates to true. Allowed values: break, continue.

Control Attributes

None

Example

Define missing title attributes.

<api:call op="fileListDir" output="out">
  <api:notnull attr="filename">
      <api:set attr="[title]" value="[filename]"/>
    <api:else>
      <api:set attr="[title]" value="Unnamed file"/>
    </api:else>
  </api:notnull> 
  <api:push title="[title]">
  [out.file:*]
  </api:push>
</api:call>

See Also

  • api:else: Create a block which is executed if the condition is not satisfied.