Try OpenEdge Now
skip to main content
Working with XML
Reading XML Documents with the Simple API for XML (SAX) : Understanding ABL SAX
 

Understanding ABL SAX

If you have already handled XML documents using the ABL support for DOM, then you know that an XML document in the ABL environment can be represented by an X-document object. An XML element can be represented by an X-noderef object. You interact with XML documents and XML elements using the attributes and methods of these ABL objects.
Similarly, the ABL SAX interface provides you with three ABL objects:
*SAX-reader
*SAX-attributes
*SAX-writer (see Writing XML Documents with the Simple API for XML (SAX))
The ABL SAX-reader lets you do the following:
*Provide callback procedures for the SAX API to automatically invoke as it parses a document
*Enable or disable DTD and XML Schema validation and namespace processing
*Parse an XML document with one call or multiple calls
*Monitor the state of a parse
*Detect and handle errors
The ABL SAX-attributes object is automatically created and destroyed by the ABL Virtual machine (AVM) as needed at parse time to handle the attributes read for a single document element.
You can also create your own SAX-attributes objects to save the contents of automatically created SAX-attributes objects or, perhaps, to assemble a collection of XML attributes that you plan to apply to elements as you create a new XML document.
These topics are discussed in the following sections:
*SAX-reader object
*ABL SAX callbacks
*SAX-attributes object
*Validation
*Namespace processing
*Parsing with one call or with multiple calls
*Monitoring the state of the parse
*Error handling
* SAX-reader object
* ABL SAX callbacks
* SAX-attributes object
* Validation
* Namespace processing
* Parsing with one call or with multiple calls
* Monitoring the state of the parse
* Error handling