CALL "C$XML" USING CXML-GET-COMMENT, handle, data, len


CXML-GET-COMMENT Op-code 24. 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
data pic x(n)


pic x(n)

On Entry:

handle Is an element handle or parser handle.

On Exit:


Is returned as the comment for the handle.

len (If provided) is the length of the comment.


When comments are returned to the COBOL program, they are separated by a single byte of low-values as they are in the XML file. For example:

<!-- this is a multi-line comment for a single XML file.-->

is returned to the COBOL program as a single string. But this comment:

<!-- this is two separate comments --> <!-- this is the second line of the separate comment -->

is returned to the COBOL program with a single byte of LOW-VALUES separating the separate lines and comment. The final line is terminated by two bytes of LOW-VALUES, so you know how many lines of comments are in the XML file.

If you pass the third optional len parameter to C$XML when getting comments, the length in bytes is returned in that parameter.