Expression attribute with local Viper method call

Warning: When calling a local viper methodĀ from withini an expression attribute value, the prefix "this." references the immediate parent macro, i.e. the <se:if> macro. In order to call local viper methods on the macro surrounding the conditional expression, specify "this.parent." asĀ the viper method prefix.

Smartsite SXML CopyCode image Copy Code
<se:xmldatatable save="inputdatatable" resulttype="datatable">
    <se:row>
        <se:col name="Animal">Tiger</se:col>
        <se:col name="Legs" datatype="integer">4</se:col>
        <se:col name="Diet">carnivore</se:col>
    </se:row>
    <se:row>
        <se:col>Owl</se:col>
        <se:col>2</se:col>
        <se:col>carnivore</se:col>
    </se:row>
    <se:row>
        <se:col>Snake</se:col>
        <se:col>0</se:col>
        <se:col>carnivore</se:col>
    </se:row>
    <se:row>
        <se:col>Rabbit</se:col>
        <se:col>4</se:col>
        <se:col>herbivore</se:col>
    </se:row>
    <se:row>
        <se:col>Bee</se:col>
        <se:col>6</se:col>
        <se:col>herbivore</se:col>
    </se:row>
    <se:row>
        <se:col>Human</se:col>
        <se:col>2</se:col>
        <se:col>omnivore</se:col>
    </se:row>
    <se:row>
        <se:col>Bear</se:col>
        <se:col>4</se:col>
        <se:col>omnivore</se:col>
    </se:row>
</se:xmldatatable>

<se:format inputdata="inputdatatable" rem="render datatable in an html table">
    <se:rowformat>
       <se:if expression="this.parent.field('Animal')=='Human'">
          <p>Human animal.</p>
       </se:if>
    </se:rowformat>
</se:format>
Example Result CopyCode image Copy Code
<p>Human animal.</p>