om.SaxDocumentHandler.createForName
Creates a new SAX document handler object for the given .4gl module.
Syntax
om.SaxDocumentHandler.createForName(
moduleName STRING )
RETURNS om.SaxDocumentHandler
- moduleName is the name of the .4gl module defining the document handler events.
Usage
The om.SaxDocumentHandler.createForName()
method creates a
om.SaxDocumentHandler
instance and binds the .42m module
passed as argument to the object.
To hold the reference to a SAX document handler object, define a variable with
the type om.SaxDocumentHandler
type.
The module must be available as a compiled .42m file, which is loadable based on the environment settings (FGLLDPATH).
The module must implement the following functions to process the SAX filter events:
Function | Description |
---|---|
|
Called once at the beginning of the document processing. |
|
Called once at the end of the document processing. |
|
Called when an XML element is reached.
Use the om.SaxAttributes
methods to handle the attributes of the processed element. |
|
Called when the end of an XML element is reached. |
|
Called when a processing instruction is reached. |
|
Called when a text node is reached. |
|
Called when an unknown entity node is reached (like &xxx; for example). |
Example
DEFINE f om.SaxDocumentHandler
LET f = om.SaxDocumentHandler.createForName("mysaxmod")
...
For a complete example, see Example 1: Extracting phone numbers from a directory.