Oracle8i Application Developer's Guide - XML Release 3 (8.1.7) Part Number A86030-01 |
|
Using XML Transviewer Beans, 5 of 15
DOMBuilder() class implements an eXtensible Markup Language (XML) 1.0 parser according to the World Wide Web Consortium (W3C) recommendation, to parse an XML document and build a DOM tree.
The parsing is done in a separate thread and DOMBuilderListener interface must be used for notification when the tree is built.
DOM Builder Bean encapsulates XML Parser for Java with a bean interface. It extends its functionality to permit asynchronous parsing. By registering a listener, a Java application can parse documents and return control return to the caller.
Asynchronous parsing in a background thread can be used interactively in visual applications. For example, when parsing a large file with the normal parser, the user interface can freeze till the parsing has completed. This can be avoided with the DOMBuilder Bean. After calling the DOMBuilder Bean parse method, the application can receive control back immediately and display "Parsing, please wait". If a "Cancel" button is included you can also cancel the operation. The application can continue when domBuilderOver()
method is called by DOMBuilder bean when background parsing task has completed.
When parsing a large number of files, DOMBuilder Bean can save you much time. Up to 40% faster times have been recorded when compared to parsing the files one by one.
Figure 20-1 illustrates DOMBuilder Bean usage.
DOMBuilder.addDOMBuilderListener(DOMBuilderListener)
method. This adds DOMBuilderListener.
Available DOMBuilderListener methods are:
|
Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|