FSD Choice tag
The choice tag defines a sequence of records, choices or other sequences. Unlike sequence, a choice uses pattern matching to pick the best match of the records contained in the choice.
<choice>
name
output='yes|no'
max-occur
min-occur>
<record/>
<choice/>
<sequence/>
</choice>
Attributes
name
Defines the name of the choice. If the output attribute is set to yes then this name is used as the XML tag name in the output, and used to match the choice with an XML tag during input.
output
Defines if the sequence appears in the output or not. The valid values for this attribute are:
- yes
means the a tag is generated in the output
- no
means the sequence only describes the data structure and does not appear in the output.
The default value is yes.
- yes
max-occur
Defines the maximum number of occurrences for the choice. A value of zero means there can be any number of occurrences.
The default value is one.
min-occur
Defines the minimum number of occurrences for the choice.
The default value is zero.
Remarks
The choice element looks for the best matching record to process the data. The match is based on attributes such as the valid-value for a field, the record separator and the minimum and maximum occurrences attributes.
The pattern matching for this element imposes a performance overhead. As such, this element should be used with care.