<forEach> (For Each)

A looping structure, similar to a for loop in a programming language, which defines what data model points will use this layout node.

example:
<forEach name="Name5" ref="" axis="ch" ptType="node">
	<layoutNode name="node1" styleLbl="" moveWith="">
	<alg type="sp"/>
	<shape xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:blip="">
	<adjLst/>
	</shape>
	<constrLst/>
	</layoutNode>
</forEach>

In this example, the <forEach> element will create a layout node, referenced by the name node1, for every associated data model point in the diagram. In this particular instance the <forEach> will create the layout node for every child of the current point node. ]

Parent Elements

<else>5.9.2.12); <forEach>5.9.2.14); <if>5.9.2.15); <layoutNode>5.9.2.19)

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

<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).

<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 possible values for this attribute are defined by the XML Schema string datatype.

<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).

<ref> (Reference)

When used on a for-each element, causes the specified for-each element to be used instead.

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

<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).

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

<complexType name="CT_ForEach">
	<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=""/>
	<attribute name="ref" type="xsd:string" use="optional" default=""/>
	<attributeGroup ref="AG_IteratorAttributes"/>
</complexType>