Skip to Content

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).

image

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;

image

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;

image

Now when you do a F11 (Menu -> Intelliscript -> Mark Example), you will notice that the immediate 05 record is being skipped by the parser.

image

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.

image

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.

image

Continue to create the nested RepeatingGroup for Node E. and finally the result;

image

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)

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

    1. Shabarish Vijayakumar Post author
      Michael,

      this is one of the first blogs that discusses CA in detail. I had planned for a single blog but then the content with the screen shots was getting a bit too lengthy and we all know no one likes reading a lengthy article (something like reading a long email i guess) ๐Ÿ™‚

      and abt the wiki entry, i would still like the keepers od SDN to define wht really should go in as a wiki and what not !!! but then i still feel, this blog wudnt really fit as a wiki….

      ShaBZ !!!

      (0) 

Leave a Reply