Read customer data and write to a TEMP-TABLE example
- Last Updated: October 17, 2024
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
This example is a SAX version of the DOM example described in Read and Write XML with the Document Object Model (DOM). The
example reads an XML file containing the Customer table
from the Sports database and writes the data to
a temp-table. The example uses qname, assumes there
is no namespace prefix, and, for clarity, omits code for transaction
scoping and validation. The SAX driver procedure, i-sax2d.p,
is shown here:
i-sax2d.p
|
i-sax2.xml
i-sax2.xml is the associated XML document.
|
Note: There is no DTD or XML Schema and no use of
namespace prefixes. The lack of a DTD or XML schema means that the
handlers need to validate the document, but this example omits that
validation for the sake of clarity.
i-sax2h.p
i-sax2h.p is the handler procedure.
|
Note: Alternately, you could use the
RETURN
ERROR error-object-expression syntax and handle the resulting error object with a
CATCH block in the caller. For more information on this
type of structured error handling, see ABL Error
Handling.