Oracle8i Application Developer's Guide - XML Release 3 (8.1.7) Part Number A86030-01 |
|
Using XML Transviewer Beans, 6 of 15
The XSL Transformer Bean accepts an XML file and applies the transformation specified by an input XSL stylesheet, to create and output file. It enables you to transform an XML document to almost any text-based format including XML, HTML and DDL, by applying an XSL stylesheet.
When integrated with other beans, XSL Transformer Bean enables an application or user to view the results of transformations immediately.
This bean can also be used as the basis of a server-side application or servlet to render an XML document, such as an XML representation of a query result, into HTML for display in a browser.
The XSL Transformer Bean encapsulates the Java XML Parser XSL-T processing engine with a bean interface and extends its functionality to permit asynchronous transformation.
By registering a listener, your Java application can transform large and successive documents by having the control returned immediately to the caller.
XSL transformations can be time consuming. Use XSL Transformer bean in applications that transform large number of files. It can transform multiple files concurrently.
XSL Transformer Bean can be used for visual applications for a responsive user interface. There are similar issues here as with DOMBuilder bean.
By implementing XSLTransformerListener() method, the caller application can be notified when the transformation is complete. The application is free to perform other tasks in between requesting and receiving the transformation.
This scenario illustrates one way of applying XSL Transformer Bean.
The HTML stored in the CLOB table always mirrors the last data stored in the tables being queried. A JSP (Java Server Page) can display the HTML.
In this scenario, multiple end users do not produce multiple data queries that contribute to bigger loads to the database. The HTML is regenerated only when the underlying data changes and only then.
Figure 20-2 illustrates the XSL Transformer Bean usage. For examples of implementing this bean, see "Transviewer Bean Example 1: AsyncTransformSample.java".
XSLTransfomer.addXSLTransformerListener(XSLTransformerListener).
This adds a listener.
XSLTransformerListener.xslTransformerOver()
method is called. This interface must be implemented in order to receive notifications about events during the asynchronous transformation. The class implementing this interface must be added to the XSLTransformer event queue using addXSLTransformerListener
method.
Table 20-2 XSLTransformer Bean: Methods
|
![]() Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
|