Progressive scan example
- Last Updated: May 21, 2026
- 4 minute read
- OpenEdge
- Version 13.0
- Documentation
This example demonstrates the progressive scan technique for parsing XML. Unlike the
single-call technique, the driver procedure calls SAX-PARSE-FIRST()
once to initiate parsing, then calls SAX-PARSE-NEXT() in a loop to
advance one XML token at a time. Between calls to SAX-PARSE-NEXT(), the
business logic runs. In this case, it checks whether the callbacks have stored a
complete Customer record and displays it before the next parse call.
This inverts the control flow from the single-call approach: instead of callbacks
driving the business logic directly, the business logic drives the parse.
This example reads customer data from i-sax2.xml (the same XML file used in Read customer data and write to a TEMP-TABLE example).
i-sax3d.p
i-sax3d.p is the driver procedure.
|
i-sax3h.p
i-sax3h.p is the persistent handler procedure. Each callback
stores incoming values into module-level variables rather than acting on them
directly. The driver accesses completed records through the
isCustomerComplete, getCustomerData, and
resetCustomer entry points.
|
PARSE-STATUS values
(SAX-RUNNING, SAX-COMPLETE,
SAX-PARSER-ERROR), see Monitor the state of the parse.