Processing XML input
You can process XML input in a COBOL program by using the XML
PARSE
statement.
About this task
The XML
PARSE
statement is the COBOL language interface to the high-speed
XML parser that is part of the COBOL run time.
Processing XML input involves passing control between the XML parser and a processing procedure in which you handle parser events.
Use the following COBOL facilities to process XML input:
- The
XML PARSE
statement to begin XML parsing and to identify the source XML document and the processing procedure - The processing procedure to control the parsing, that is, receive and process XML events and associated document fragments, and return to the parser for continued processing
- Special
registers to exchange information between the parser and
the processing procedure:
XML-CODE
to receive the status of XML parsing and, in some cases, to return information to the parserXML-EVENT
to receive the name of each XML event from the parserXML-NTEXT
to receive XML document fragments that are returned as national character dataXML-TEXT
to receive document fragments that are returned as alphanumeric data
Related tasks
Accessing XML documents
Parsing XML documents
Handling XML PARSE exceptions
Terminating XML parsing
Accessing XML documents
Parsing XML documents
Handling XML PARSE exceptions
Terminating XML parsing
Related references
The encoding of XML documents
XML reference material
Extensible Markup Language (XML)
The encoding of XML documents
XML reference material
Extensible Markup Language (XML)