Basic tasks of an OpenEdge SAX application
- Last Updated: June 3, 2021
- 1 minute read
- OpenEdge
- Version 13.0
- Documentation
A typical ABL SAX application performs the following tasks:
- Creates a SAX-reader object
- Runs a persistent procedure or instantiates a class instance that contains the SAX callbacks
- Configures the SAX-reader object by:
- Setting its
HANDLERattribute to the handle of the routine that contains the SAX callbacks - Turning namespace processing and validation on or off as needed
- Specifying the input source using the
SET-INPUT-SOURCE( )method
- Setting its
- Starts the parser by calling the
SAX-PARSE( )orSAX-PARSE-FIRST( )method - Handles XML data passed to the callbacks as the parser proceeds
- Monitors the state of the parse by checking error codes and the
parse status after each call to the
SAX-PARSE( ),SAX-PARSE-FIRST( ), andSAX-PARSE-NEXT( )methods - Releases resources, including deleting the SAX-reader object
Most of these tasks can be performed using the attributes and methods of the SAX-reader object, which are summarized in the following table.
| To perform this task . . . | Use this attribute or method . . . |
|---|---|
| Specify the XML input |
SET-INPUT-SOURCE( ) method |
| Specify a search path for the DTD |
SCHEMA-PATH attribute |
| Specify the location of XML Schema documents with namespace and location pairs |
SCHEMA-LOCATION attributeADD-SCHEMA-LOCATION( ) method |
| Specify the location of the XML Schema used to validate XML elements that do not specify a namespace |
NONAMESPACE-SCHEMA-LOCATION
attribute |
| Tell the parser where the callbacks reside |
HANDLER attribute or EVENT-HANDLER-OBJECT attribute |
| Toggle parser options |
SUPPRESS-NAMESPACE-PROCESSING
attributeVALIDATION-ENABLED attribute |
| Start, continue, or stop parsing |
SAX-PARSE( ) methodSAX-PARSE-FIRST( ) methodSAX-PARSE-NEXT( )
methodSTOP-PARSING( ) method |
| Get the status of the parse |
LOCATOR-COLUMN-NUMBER attributeLOCATOR-LINE-NUMBER attributeLOCATOR-PUBLIC-ID attributeLOCATOR-SYSTEM-ID
attributePARSE-STATUS attribute |
| Get or set information concerning this particular SAX-reader object |
PRIVATE-DATA attribute |