Parsing data for delfor 96A

Hi All,
i am working on UNEDIFACT Delfor 96A standard and using webMethods v4.6 with service packs patch 2. I struck in a problem where segements are uncorrectly collecting under the UNH segment level.

I am using the following services to parse the data:
getTemplate
recordToDocument
convertToValues

The above program works fine when the sequence of segments in the data file is
UNH


UNS
NAD
LOC
LIN
RFF
QTY

we are able to process the data correctly.

But when the sequence changes to:
UNH


UNS
NAD
LIN <–
LOC <–
RFF
QTY

all the segments after UNS appear uncorrectly at the same level under UNH. All the RFF datas are collected under one RFF

segment, all the QTY datas are collected under the same one QTY segment.

WRONG OUTPUT:

-UNH
|-BGM
|
-RFF
| |-DTM
|
-UNS
|-NAD
| |
-CTA
-LIN
|
-LOC
|
-RFF
|
-QTY
|-QTY[0]
|
-QTY[1]
|-QTY[2]

-SCC
|
-SCC[0]
|-SCC[1]

-DTM
|
-DTM[0]
|___-DTM[1]

while it should show like this

RIGHT OUTPUT:



|-LIN
|
-LOC
| |-QTY[0]
| |
-SCC
| |-DTM
|
-QTY[1]
| |-SCC
| |
-DTM

And to add to worse the program is also not showing any error.

Can anyone can tell where the problem goes.

Here is the attachment of the data file which we tried to process.

delfor sample
test file.txt (1.0 k)