pc:then

Previous Next

Identifies a script section that executes only if a condition specified in the test attribute of a <pc:if> parent object evaluates to true.

Syntax

<pc:if test="xpath >> boolean">>
 
  <pc:then>
 
    conditional-content
 
  </pc:then>
 
  <pc:else>
 
    conditional-content
 
  </pc:else>
 
</pc:if>

<pc:then> is only legal as the first child element of a <pc:if> element.

 

Example

The element <PrintThis/> is written to standard output in:

<pc:if test="1=1">
  <pc:then> <PrintThis/> </pc:then>
  <pc:else> <PrintThat/> </pc:else>
</pc:if>

 

See

pc:if