|
| |
PParse demonstrates progressive parsing.
In this example, the programmer doesn't have to depend upon throwing
an exception to terminate the parsing operation. Calling parseFirst() will
cause the DTD to be parsed (both internal and external subsets) and any
pre-content, i.e. everything up to but not including the root element.
Subsequent calls to parseNext() will cause one more piece of markup to
be parsed, and spit out from the core scanning code to the parser. You
can quit the parse any time by just not calling parseNext() anymore
and breaking out of the loop. When you call parseNext() and the end
of the root element is the next piece of markup, the parser will
continue on to the end of the file and return false, to let you
know that the parse is done.
|
|
|