Given a DOM node, selects all nodes that match a specified pattern and iterates over each selected node.

Class Name

atg.droplet.xml.NodeForEach

Component

/atg/dynamo/droplet/xml/NodeForEach

Required Input Parameters

node

The DOM node to pass to this servlet bean.

Optional Input Parameters

select

Sets the pattern that is used to select the nodes to iterate over. The pattern language conforms to the pattern definition provided by the XPath specification at http://www.w3.org/TR/xpath. If no pattern is provided, then NodeForEach selects all the children of this node.

Output Parameters

index

Set to the zero-based index of the current element of the set of nodes each time the output parameter is rendered.

count

Set to the one-based index of the current element of the set of nodes each time the output parameter is rendered. The value of count for the first iteration is 1.

element

Set to the current element of the set of nodes each time the index increments and the output parameter is rendered.

Open Parameters

output

Rendered once for each element in the set of nodes.

outputStart

If any nodes are selected, rendered before any output elements. For example, this parameter can be used to render the table heading.

outputEnd

If any nodes are selected, rendered after all output elements. For example, this parameter can be used to render text following a table.

empty

Rendered if no nodes are selected.

Usage Notes

NodeForEach selects a set of Data Object Model nodes using a pattern and renders its output parameters for each of the nodes. The NodeForEach servlet bean is based on the ForEach servlet bean and inherits its output and open parameter definitions from ForEach.

Example

See Processing XML in a JSP.

 
loading table of contents...