Progress
External Program
Interfaces


Parsing With One Call Or With Multiple Calls

A Progress SAX application can parse an XML document using one of the following techniques:

To use the single-call technique, the application calls the SAX-PARSE() method once. The parser parses the entire XML document (unless errors occur), calling all appropriate callbacks, and returns control to the line in the code following SAX-PARSE().

To use the progressive-scan technique, the application calls the SAX-PARSE-FIRST() method once to initiate parsing, then calls the SAX-PARSE-NEXT() method repeatedly to parse each XML token in the document. As each XML token is detected, Progress invokes the corresponding callback. After each call to SAX-PARSE-FIRST() or SAX-PARSE-NEXT(), control returns to the line in the code following the SAX-PARSE-FIRST() or SAX-PARSE-NEXT().

Consider using progressive scan:

After calling SAX-PARSE(), SAX-PARSE-FIRST(), or SAX-PARSE-NEXT(), the application checks the value of the PARSE-STATUS attribute, as explained in the "Monitoring the State Of the Parse" section.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095