...
The basic idea is simple, but there are a few complications to consider. Let's say we have a parsed FIX message and want to format it in way that that's easier to read than tag/value pairs. We might start by simply iterating over the fields and printing their values.
...
All the fields are there now, but there are still a few problems. The group count tag is shown twice because it's also a normal top level field. We'll add a few lines of code to avoid printing the group count field as a normal field. We To do this we can ask the data dictionary for the type of a field. In this case, we are checking whether the field is a NumInGroup
type.
...