<if> (If)

Like an if statement in a programming language, wraps elements which are to be used under the conditions defined by its attributes.

example:
<choose name="Name1">
	<if name="Name2" func="var" arg="dir" op="equ" val="norm">
	<alg type="snake">
	<param type="grDir" val="tL"/>
	<param type="flowDir" val="row"/>
	<param type="contDir" val="sameDir"/>
	<param type="off" val="ctr"/>
	</alg>
	</if>
	<else name="Name3">
	<alg type="snake">
	<param type="grDir" val="tR"/>
	<param type="flowDir" val="row"/>
	<param type="contDir" val="sameDir"/>
	<param type="off" val="ctr"/>
	</alg>
	</else>
</choose>

In this example, a <if> element is used to define a set of parameters associated with the snake algorithm when the diagram is in the normal direction]

Parent Elements

<choose>5.9.2.6)

Child Elements

Subclause

<alg> (Algorithm)

§5.9.2.3

<choose> (Choose Element)

§5.9.2.6

<constrLst> (Constraint List)

§5.9.2.9

<extLst> (Extension List)

§5.9.2.13

<forEach> (For Each)

§5.9.2.14

<layoutNode> (Layout Node)

§5.9.2.19

<presOf> (Presentation Of)

§5.9.2.21

<ruleLst> (Rule List)

§5.9.2.25

<shape> (Shape)

§5.9.2.27

Attributes

Description

<arg> (Argument)

Specifies the variable to use as part of the test in an if element.  Ignored unless the function attribute is set to "var".

The possible values for this attribute are defined by the ST_FunctionArgument simple type (§5.9.7.29).

<axis> (Axis)

Specifies the axis on which to select data from the data model.

The possible values for this attribute are defined by the ST_AxisTypes simple type (§5.9.7.7).

<cnt> (Count)

Specifies the count of items to use in a data set.

<forEach name="Name5" ref="" axis="ch" ptType="node" cnt="2">

...

</forEach>

In this example, up to two children will be obtained through this <forEach>. ]

The possible values for this attribute are defined by the ST_UnsignedInts simple type (§5.9.7.63).

<func> (Function)

The function used to evaluate the if condition.

<if name="Name2" func="var" arg="dir" op="equ" val="norm">
...
</if>

In this example, func is set to var. ]

The possible values for this attribute are defined by the ST_FunctionType simple type (§5.9.7.31).

<hideLastTrans> (Hide Last Transition)

In algorithms that support transitions, this attribute specifies that the last transition will not be rendered.  This allows for diagrams that start and end with a node.

The possible values for this attribute are defined by the ST_Booleans simple type (§5.9.7.9).

<name> (Name)

A unique identifier for the layout node.

The function used to evaluate the if condition.

<if name="Name2" func="var" arg="dir" op="equ" val="norm">
...
</if>

In this example, the name attribute is set to Name2. ]

The possible values for this attribute are defined by the XML Schema string datatype.

<op> (Operator)

The operator used to evaluate the condition.

<if name="Name2" func="var" arg="dir" op="equ" val="norm">
...
</if>

In this example, @op is being used to test the equality of the argument and value. ]

The possible values for this attribute are defined by the ST_FunctionOperator simple type (§5.9.7.30).

<ptType> (Data Point Type)

Specifies the type of data point to select.

<forEach name="Name5" ref="" axis="ch" ptType="node" cnt="2">

...

</forEach>

In this example, the <forEach> will select all node type points in the set. ]

The possible values for this attribute are defined by the ST_ElementTypes simple type (§5.9.7.26).

<st> (Start)

Specifies where to start in a data set.

<presOf axis="desOrSelf" ptType="node" st="2"/>

In this example, the second element in the set will be the first point returned. ]

The possible values for this attribute are defined by the ST_Ints simple type (§5.9.7.39).

<step> (Step)

Specifies the step to use in a data set. A @step with a value of 2 will return every other item in the set.

The possible values for this attribute are defined by the ST_Ints simple type (§5.9.7.39).

<val> (Value)

An absolute value.

The possible values for this attribute are defined by the ST_FunctionValue simple type (§5.9.7.32).

The following XML Schema fragment defines the contents of this element:

<complexType name="CT_When">
	<choice minOccurs="0" maxOccurs="unbounded">
	<element name="alg" type="CT_Algorithm" minOccurs="0" maxOccurs="1"/>
	<element name="shape" type="CT_Shape" minOccurs="0" maxOccurs="1"/>
	<element name="presOf" type="CT_PresentationOf" minOccurs="0" maxOccurs="1"/>
	<element name="constrLst" type="CT_Constraints" minOccurs="0" maxOccurs="1"/>
	<element name="ruleLst" type="CT_Rules" minOccurs="0" maxOccurs="1"/>
	<element name="forEach" type="CT_ForEach"/>
	<element name="layoutNode" type="CT_LayoutNode"/>
	<element name="choose" type="CT_Choose"/>
	<element name="extLst" type="a:CT_OfficeArtExtensionList" minOccurs="0" maxOccurs="1"/>
	</choice>
	<attribute name="name" type="xsd:string" use="optional" default=""/>
	<attributeGroup ref="AG_IteratorAttributes"/>
	<attribute name="func" type="ST_FunctionType" use="required"/>
	<attribute name="arg" type="ST_FunctionArgument" use="optional" default="none"/>
	<attribute name="op" type="ST_FunctionOperator" use="required"/>
	<attribute name="val" type="ST_FunctionValue" use="required"/>
</complexType>