CXML-PARSE-FILE

Syntax:

CALL "C$XML" USING CXML-PARSE-FILE, filename

Parameters:

CXML-PARSE-FILE Op-code 1. Numeric data item that specifies the operation to perform. Each operation is defined in acucobol.def, which is included with your system.
filename pic x(n) or alphanumeric literal

On Entry:

CXML-PARSE-FILE Value 1
filename The name of the XML document to parse

On Exit:

RETURN-CODE Parser handle for the XML document. You should move the return code to a Working-Storage USAGE HANDLE that you have declared.

Comments:

This operation parses the specified file, returning a parser handle as the return-code. To read a file from the Internet and parse it, you can pass the filename with URL syntax. For example, you could pass the following filename:

http://myserver.mycomp.com/xmldata/bookfile.xml

Use this op-code when the file is fairly small, and you want to read and parse the whole file with a single call and store it in memory.

Example:

working-storage section.
01 parser-handle usage is handle.
COPY "acucobol.def".
procedure division.
main-logic.  
*Parse an XML file 
   call "C$XML" using CXML-PARSE-FILE, http://myserver.mycomp.com/xmldata/bookfile.xml 
   move return-code to parser-handle.