I am trying to convert a FLAT file to XML using DFDL. It has following format: Each element is 5 byte.All are in same line but i am separating them to avoid confusion. I will address element by first letter in them.
0AAAA
81AAA
eeeee
qqqqq
82BBB
rrrrr
sssss
9QQQQ
Now 0 and 9 are grandparents we don't have to worry about them. 8 is parent and second byte of 81AAA(that is 1) will determine the format of its children. There can be many 8 and many children of a 8 parent(but all of them will have same format).
I tried one schema but once it go into children(eeeee) its not coming out of it and every record is being printed in children format only.
Below is a schema that I think describes your data, tested on Daffodil 2.2.0:
A description of how this works:
With this, your example data parses to an infoset like so: