I am trying to convert a rally complex fixed length file into XML using DFDL and Daffodil. Each line will be responsible for one element and first element of each line will tell me what kind of element it will be. It can be Parent A or Parent B or it can be child AA or AB or BB or BA.
Where Parent A is one element ,Parent B is another and Child AA is first child of Element A.
Inside one file there are multiple Parent A and Parent B. I tried initiator tag even tried choice tag but nothing seems to be working. Can anyone please help me out.
It's difficult to give a complete answer without example data, but using initiators and choices is likely the right approach. There are potentially simpler schemas depending on the specific data, but a generic solution might look something like this:
This schema has the following features:
The above allows data like this:
Which would parse into an XML infoset like this:
The above is tested with Apache Daffodil 2.2.0