21.4.2.14 forEach
A looping structure, similar to a for loop in a programming language, which defines what data model points use this layout node.
[Example: Consider the following example of a forEach being used within a DrawingML diagram:
<forEach name="Name5" ref="" axis="ch" ptType="node">
<layoutNode name="node1" styleLbl="" moveWith="">
<alg type="sp"/>
<shape
xmlns:r="http://purl.oclc.org/ooxml/officeDocument/relationships" r:blip="">
<adjLst/>
</shape>
<constrLst/>
</layoutNode>
</forEach>
In this example, the forEach element creates a layout node, referenced by the name node1, for every associated data model point in the diagram. In this particular instance the forEach creates the layout node for every child of the current point node. end example]
Attributes
axis (Axis)
Specifies the axis on which to select data from the data model.
[Example: axis=“ch” selects children of the current point node and axis=“des” selects all descendants. end example]
The possible values for this attribute are defined by the ST_AxisTypes simple type (21.4.7.7).
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 W3C XML Schema string datatype.
ptType (Data Point Type)
Specifies the type of data point to select.
[Example:
Consider the following example of a forEach
in a DrawingML diagram:
<forEach name="Name5" ref="" axis="ch" ptType="node" cnt="2">
…
</forEach>
In this example, the forEach selects all node type points in the set. end example]
The possible values for this attribute are defined by the ST_ElementTypes simple type (21.4.7.28).
name (Name)
A unique identifier for the layout node.
The possible values for this attribute are defined by the W3C XML Schema string datatype.
hideLastTrans (Hide Last Transition)
In algorithms that support transitions, this attribute specifies that the last transition is not 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 (21.4.7.9).
cnt (Count)
Specifies the count of items to use in a data set.
[Example:
Consider the following example of a forEach
in a DrawingML diagram:
<forEach name="Name5" ref="" axis="ch" ptType="node" cnt="2">
…
</forEach>
In this example, up to two children are obtained through this forEach. end example]
The possible values for this attribute are defined by the ST_UnsignedInts simple type (21.4.7.63).
step (Step)
Specifies the step to use in a data set. A step with a value of 2 returns every other item in the set.
The possible values for this attribute are defined by the ST_Ints simple type (21.4.7.40).
st (Start)
Specifies where to start in a data set.
[Example:
Consider the following example of a forEach
in a DrawingML diagram:
<presOf axis="desOrSelf" ptType="node"
st="2"/>
In this example, the second element in the set is the first point returned. end example]
The possible values for this attribute are defined by the ST_Ints simple type (21.4.7.40).
[Note: The W3C XML Schema definition of this element’s content model (CT_ForEach) is located in A.5.3. end note]