Progress
External Program
Interfaces
Example 1 — Retrieving Names and Phone Numbers
This example retrieves names and phone numbers. It is presented in two versions in the following sections:
Without Namespace Processing
Here is the EPI SAX Example 1 driver, e-sax1d.p (1 of 2). The driver’s logic closely parallels the tasks in the "Basic Tasks Of a Progress SAX Application" section.
Here is the EPI SAX Example 1 XML file, e-sax1.xml. Each entry contains a name and phone number.
Here is the EPI SAX Example 1 handler procedure, e-sax1h.p (1 of 2). It contains the callbacks.
When Example 1 is run, it produces the trace shown in Table 12–8.
With Namespace Processing
Here is the same example except that the XML document uses Namespaces. Consequently, the StartElement and EndElement callbacks in the handler use the namespaceURI and localName parameters rather than qName.
NOTE: The original example could have used localName by itself, but did not.Here is the EPI SAX Example 1 driver with namespace processing, e-sax1dn.p (1 of 2).
Here is the EPI SAX Example 1 XML file with namespace processing, e-sax1n.xml.
Here is the EPI SAX Example 1 handler procedure with namespace processing, e-sax1hn.p (1 of 3).
When Example 1 with namespace processing is run, it produces the trace shown in Table 12–9.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |