Writing procedures to process XML
In your processing procedure, code the statements to handle XML events.
For each event that the parser encounters, it passes information to your processing procedure in several special registers, as shown in the following table. Use these registers to populate your data structures and to control your processing.
| Special register | Contents | Implicit definition and usage |
|---|---|---|
| XML-EVENT1 | The name of the XML event | PICTURE X(30) USAGE DISPLAY VALUE SPACE |
| XML-CODE | An exception code or zero for each XML event | PICTURE S9(9) USAGE BINARY VALUE ZERO |
| XML-TEXT1 | Text (corresponding to the event that the parser encountered) from the XML document if you specify an alphanumeric data item for the XML PARSE identifier | Variable-length alphanumeric data item; 16,000,000 byte size limit |
| XML-NTEXT1 | Text (corresponding to the event that the parser encountered) from the XML document if you specify a national data item for the XML PARSE identifier | Variable-length national data item; 16,000,000 byte size limit |
|
||
When used in nested programs, these special registers are implicitly defined as GLOBAL in the outermost program.