I have the following xml-structure that I want to parse in Cobol.
<LDO>
<OD>1</OD> //OD 1'st occurrence
<OLD>1</OLD> //OLD 1'st occurrence
<OLD>2</OLD> //OLD 2'nd occurrence
<OLD>3</OLD> //OLD 3'rd occurrence
<OD>2</OD> //OD 2'nd occurrence
<OLD>4</OLD> //OLD 4'th occurrence
</LDO>
As you guys can see there is several OLD tags after an OD tag. What I want to do is reading this xml file step by step and display it's attributes in the following way:
1 1 2 3 2 4
READ xml-stream.
START xml-stream KEY IS OD.
*>check status
START xml-stream KEY IS OLD.
*> check stream status
PERFORM UNTIL EXIT
READ xml-stream next key is
old
IF stream-status = -7
EXIT PERFORM
END-IF
*> check stream status less than 0
display od-value
display old-value
But the od-value doesn't change when i excecute the program. It return the following values
1 1 2 3 1 4
I want that the second occurrence to return the value of the second element OD not the first one.
I would like some help to achieve this.