Iterators

This section explains how to create an iterator at the Instance Level (Instance element) in a requirements file. Iterators allow authors to repeat content multiple times for containers of a collection (for example, / Txn/Beneficiaries or /Txn/Beneficiaries/Beneficiary). Iterators can be used to print name and address for each /Txn/Beneficiaries/Beneficiary, or for each /Txn/Beneficiaries/Beneficiary[Type='4'] identified in a document. In general, the guidelines for creating an iterator include:

Before creating an iterator, verify the Iterator is a parent to the Instance element and that the Business Logic within the Iterator explains all pertinent scenarios.

Note: In the PTR for the Iterator, separate each scenario with a pipe ("|").