CXML-GET-FIRST-CHILD

Syntax:

CALL "C$XML" USING CXML-GET-FIRST-CHILD, handle

Parameters:

CXML-GET-FIRST-CHILD Op-code 3. Numeric data item that specifies the operation to perform. Each operation is defined in acucobol.def, which is included with your system.
handle USAGE handle

On Entry:

CXML-GET-FIRST-CHILD Value 3
handle A parser handle or an element handle. If a parser handle, returns the first child of the top-level element.

On Exit:

RETURN-CODE A handle of the first child element, or 0 if there are no children. (The case of no children is not considered an error, even though CXML-GET-LAST-ERROR will return 10.)

Comments:

This operation retrieves the handle of the first child element of the handle passed and places it in return-code. You should move return code to an element handle that you have declared in Working-Storage

Example:

working-storage section.
01 parser-handle usage is handle.
01 element-1-handle usage is handle.
COPY "acucobol.def".
procedure division.
main-logic.  
*Get child element 
   call "C$XML" using CXML-GET-FIRST-CHILD, parser-handle
   move return-code to element-1-handle.