Oracle8i Application Developer's Guide - XML Release 3 (8.1.7) Part Number A86030-01 |
Library | Service | Contents | Index

Using XML Transviewer Beans, 9 of 15

## Using XMLTransformPanel() Bean (oracle.xml.transviewer API)

XMLTransformPanel visual bean applies XSL transformations to XML documents. It visualizes the result and allows editing of input XML and XSL documents and files.

This bean required no programmatic input. It is a component that interacts directly with you and is not customizable.

### XMLTransformPanel Bean Features

XMLTransformPanel Bean also has the following features:

- Imports and exports XML and XSL files from the file system, and XML, XSL, and HTML files from Oracle8i. With Oracle8i, XSL Transformer Bean uses two-column CLOB tables. The first column stores the data name (file name) and the second stores the data text (file's data) in a CLOB. The bean lists all CLOB tables in your schema. When you click on a table, the bean lists its file names. You can also create or delete tables, retrieve or add files to the tables. This can be useful for organizing your information.

  Note: CLOB tables created by the XSL Transformer Bean can be used by trigger based stored procedures to mirror tables or views in the database into HTML data held in these CLOB tables. See "XSL Transviewer Bean Scenario 1: Regenerating HTML Only When Underlying Data Changes".

- Supports multiple database connections

- Creates XML from database result sets. This feature allows you to submit any SQL query to the database that you are currently connected. The bean converts the result set into XML and automatically loads this XML data into the beans XML buffer for further processing.

- Edits XML and XSL data loaded into the bean.

- Applies XSL transformations to XML buffers and show the results. With the Bean, you can also export results to the file system or a CLOB in the database.

### Transviewer Bean

This could be confusing to you, because all the beans in this chapter (and in XDK for Java) are referred to as "Transviewer Beans", but the specific "Transviewer Bean" is an application that uses XMLTransformPanel Bean, in other words, it uses the `oracle.xml.transviewer()` API.

#### Command Line Usage

Transviewer Bean can be used from the command line to perform the following actions:

- Edit and parse XML files

- Edit and apply XSL transformations

- Retrieve and save XML, XSL and result files in the file system or in Oracle8i

#### DBAccess() Class

This class maintains CLOB tables that can hold multiple XML and text documents.

Each table is created using the following statement:

    CREATE TABLE tablename FILENAME CHAR( 16) UNIQUE, FILEDATA CLOB) LOB(FILEDATA)
    STORE AS (DISABLE STORAGE IN ROW)

Each XML (or text) document is stored as a row in the table. The FILENAME field holds a unique string used as a key to retrieve, update, or delete the row. Document text is stored in the FILEDATA field. This is a CLOB object. The CLOB tables are automatically maintained by the Transviewer Bean. The CLOB tables maintained by this class can be later used by the Transviewer Bean.

The class does the following tasks:

- Creates and deletes CLOB tables

- Lists a CLOB table contents

- Adds, replaces, or deletes text documents in the CLOB tables

  See: "Transviewer Bean Example 3: XMLTransformPanelSample.java" for an example of how to use XMLTransformPanel.

| Copyright © 1996-2000, Oracle Corporation. All Rights Reserved. |
Library | Service | Contents | Index