iterate

Iterates over a collection of nodes in the model that match some criteria

For each model node in the collection, the iterate tag will assign a name to that node and process its content. DPTK tags nested in the iterate tag can refer to the current node in the iteration using that name in a query expression.


Tag Summary
 
required <iterate nodes="value" name="value" />
 
full tag <iterate nodes="value" name="value" delimiter="value" />

Required Attributes
 
nodes A query expression describing a collection of nodes from the model
name The name to assign to the current node in the iteration. Tags nested in the iterate tag can use this name in a query expression to refer to the model node or its attribute values

Optional Attributes
 
delimiter A string to be written out after every iteration but the last. Use this for comma-separated lists, for example

Example
 
<iterate
        nodes="type/property"
        name="current"
        delimiter="" >
private <attr node="current" name="type"/> <attr node="current" name="name"/>;
</iterate>

This iterate tag will start at the model node associated with the name "type" and collect all of that node's children with the name "property". For each of thode child nodes, the iterate tag will associate the name "current" with that node and process the iterate tag's content. This content contains some static text and two attr tags that write out the current node's type and name, respectively. The effect of this iterate tag is to generate a declaration of a set of properties defined for a type.


© Copyright IBM Corporation 2000, 2006. All Rights Reserved.