Now we continue on to read the Node B. Node B is nested within Node A, so this time we will create a new RepeatingGroup within the RepeatingGroup already defined for A.
(Refer the last screenshot in Part1 to add the next RepeatingGroup).
Now to read the file further to fill the Node C follow the same as specified above. Node C will be nested inside Node B. So we have a nested RepeatingGroup again. Once that is done, we will have the studio as follows;
Note that Node C is defined as 0-Unbounded in our XSD, hence do not forget to mark the ‘Optional’ parameter in the RepeatingGroup for the same. As we proceed further its 05 and 06 records that are pending to be read in the file. Node D is at the same levvel as Header and Node A and Node E is nested under Node D. I assume that you are comfortable with working on the CA studio by now.
We will move forward and make a new RepeatingGroup at the same level as of Node A for Node D. As usual we create the RepeatingGroup as follows;
Now when you do a F11 (Menu -> Intelliscript -> Mark Example), you will notice that the immediate 05 record is being skipped by the parser.
Unexpected … and it makes us think 🙂 I found two solutions to handle the same, but first we need to know why it happened. In the User guide, read the section “How a Parser Searches for Anchors”. It defines the concept of Search phase, Search scope and Search criteria that will help you control the way the parser searches for the data and the anchors.
Solution 1: In the advanced property for the RepeatingGroup for Node D, change the parameter phase to initial.
Once that is done continue as usual and create the nested RepeatingGroup for Node E.
Solution 2: You can break the search of the RepeatingGroup by defining a marker. So before we define a RepeatingGroup for Node D, create a Marker anchor. It will have a text search for the value 05 (keyfield for Node D record) and in the advanced property for the Marker anchor, change the parameter marking to the value begin position.
Continue to create the nested RepeatingGroup for Node E. and finally the result;
You can run the Script now to get the desired output XML file. Verify the output file as per this one. (Rename the file to output.xml in case the download prompt comes)