arc:notnull

Version 23.4.8843


arc:notnull

Version 23.4.8843


arc:notnull 关键字可以在指定的对象中检查属性是否有值。arc:exists 关键字与 arc:notnull 同义。

参数

  • item:要检查的对象。如果未指定,则使用默认的输出对象。
  • attr:要检查的属性名称。
  • action:如果表达式计算结果为 true 时执行的操作。允许的值有:break,continue。

控制属性

示例

定义缺少的 title 属性。

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

另请参阅

  • arc:else:创建一个代码块,如果条件不满足的话则执行该代码块。