Skip Headers

Oracle® XML Reference 10g (9.0.4) Part Number B10926-01 |
Home | Contents | Index

# 10
Oracle XML JavaBeans

Oracle XML JavaBeans are synonymous with the following packages:

- oracle.xml.async Package

- oracle.xml.dbviewer Package

- oracle.xml.srcviewer Package

- oracle.xml.transviewer Package

- oracle.xml.treeviewer Package

- oracle.xml.differ Package

  See Also: Oracle Application Developer's Guide - XML

## oracle.xml.async Package

This is a non-visual bean. It enables asynchronous DOM parsing in separate threads in the background. It utilizes the EventHandler interface to notify the calling class when the job is complete. The classes of the o`racle.xml.async` are summarized in Table 10-1.

##### Table 10-1 Summary of Classes of oracle.xml.async

Class | Description
--- | ---
DOMBuilder Class | This class encapsulates an eXtensible Markup Language (XML) 1.0 parser to parse an XML document and build a DOM tree.
DOMBuilderBeanInfo Class | This class provides information about the DOMBuilder Bean.
DOMBuilderErrorEvent Class | This class defines the error event which is sent when parse exception occurs.
DOMBuilderErrorListener Interface | This interface must be implemented in order to receive notifications when error is found during parsing.
DOMBuilderEvent Class | The event object that DOMBuilder uses to notify all registered listeners about parse events.
DOMBuilderListener Interface | This interface must be implemented in order to receive notifications about events during the asyncronous parsing.
ResourceManager Class | This class implements a simple semaphore that maintains access to a fixed number of logical resources.
XSLTransformer Class | Applies XSL transformation in a background thread.
XSLTransformerBeanInfo Class | This class provides information about the XSLTransformer Bean.
XSLTransformerErrorEvent Class | The error event object that XSLTransformer uses to notify all registered listeners about transformation error events.

## DOMBuilder Class

This class encapsulates an eXtensible Markup Language (XML) 1.0 parser 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.

#### Syntax

    public class DOMBuilder extends java.lang.Object implements
    java.io.Serializable, oracle.xml.async.DOMBuilderConstants, java.lang.Runnable

##### Table 10-2 Fields of DOMBuilder

Field | Syntax | Description
--- | --- | ---
    inSource
    protected
    org.xml.sax.InputSource
    inSource
| InputSource containing XML data to parse
    url
    protected java.net.URL url
| URL to parse XML data from
    inStream
    protected java.io.InputStream
    inStream
| InputStream containing XML data to parse
    inString
    protected java.lang.String
    inString
| String containing the URL to parse XML data from
    methodToCall
    protected int methodToCall
| XML Parser method to call based on input types
    reader
    protected java.io.Reader
    reader
| java.io.Reader containing XML data to be parsed
    result
    protected
    oracle.xml.async.XMLDocument
    result
| XML Document being parsed
    rootName
    protected java.lang.String
    rootName
| Name of the XML element to be treated as root

##### Table 10-3 Summary of Methods of DOMBuilder

Method | Description
--- | ---
DOMBuilder() | Creates a new parser object.
addDOMBuilderErrorListener() | Adds DOMBuilderErrorListener.
addDOMBuilderListener() | Adds DOMBuilderListener.
getDoctype() | Gets the DTD.
getDocument() | Gets the document for parsing.
getId() | Returns the parser object ID.
getReleaseVersion() | Returns the release version of Oracle XML Parser.
getResult() | Gets the document being parsed.
getValidationMode() | Returns the validation mode.
parse() | Parses the XML from given input.
parseDTD() | Parses the XML External DTD.
removeDOMBuilderErrorListener() | Removes the DOMBuilderErrorListener.
removeDOMBuilderListener() | Removes the DOMBuilderListener.
run() | Runs in a thread.
setBaseURL() | Sets the base URL for lading external entities and DTD.
setDebugMode() | Sets a flag to run on debug information in the document.
setDoctype() | Sets the DTD.
setErrorStream() | Creates an output stream for errors and warnings.
setNodeFactory() | Sets the node factory.
setPreserveWhitespace() | Sets the white space preservation mode.
setValidationMode() | Sets the validation mode.
showWarnings() | Determines whether to print warnings.

## DOMBuilder()

Creates a new parser object. The options are described in the following table.

Syntax | Description
--- | ---
    public  DOMBuilder();
| Creates a new parser object.
    public  DOMBuilder(
         int id);
| Creates a new parser object with a given id.

Parameter | Description
--- | ---
    id
| The DOMBuilder id.

## addDOMBuilderErrorListener()

Adds DOMBuilderErrorListener.

#### Syntax

    public void addDOMBuilderErrorListener( DOMBuilderErrorListener p0);

Parameter | Description
--- | ---
    p0
| The DOMBuilderListener to add.

## addDOMBuilderListener()

Adds DOMBuilderListener

#### Syntax

    public void addDOMBuilderListener(DOMBuilderListener p0);

Parameter | Description
--- | ---
    p0
| The DOMBuilderListener to add.

## getDoctype()

Gets the DTD.

#### Syntax

    public synchronized oracle.xml.async.DTD getDoctype();

## getDocument()

Gets the document for parsing.

#### Syntax

    public synchronized oracle.xml.async.XMLDocument getDocument();

## getId()

Returns the parser object id (DOMBuilder).

#### Syntax

    public int getId();

## getReleaseVersion()

Returns the release version of the Oracle XML Parser, as a String.

#### Syntax

    public synchronized java.lang.String getReleaseVersion();

## getResult()

Gets the document being parsed.

#### Syntax

    public synchronized org.w3c.dom.Document getResult();

## getValidationMode()

Returns the validation mode; `TRUE` if XML parser is validating, `FALSE` otherwise.

#### Syntax

    public synchronized boolean getValidationMode()

## parse()

Parses the XML from given input. Throws the following exceptions:

- `XMLParseException` If syntax or other error encountered.

- `SAXException` Any SAX exception, possibly wrapping another exception.

- `IOExceptiopn` I/O Error.

  Syntax | Description
  --- | ---
      public final synchronized void parse (
        InputSource in);
  | Parses the XML from an InputSource
      public final synchronized void parse (
        InputStream in);
  | Parses the XML from an InputStream; the base URL should be set for resolving external entities and DTD.
      public final synchronized void parse (
        Reader r);
  | Parses the XML from an Reader; the base URL should be set for resolving external entities and DTD.
      public final synchronized void parse (
        String urlName);
  | Parses the XML from the URL indicated by the argument.
      public final synchronized void parse (
        URL url);
  | Parses the XML document pointed to by the given URL and creates the corresponding XML document hierarchy.

  Parameter | Description
  --- | ---
      in
  | The input to parse.
      r
  | The Reader containing XML data to parse.
      urlName
  | The String containing the URL from which to parse.
      url
  | The ULR that points to the XML document to parse.

## parseDTD()

Parses the XML External DTD. Throws the following exceptions:

- `XMLParseException` If syntax or other error encountered.

- `SAXException` Any SAX exception, possibly wrapping another exception.

- `IOExceptiopn` I/O Error.

  Syntax | Description
  --- | ---
      public final synchronized void parseDTD (
           InputSource in,
           String rootName);
  | Parses from a given InputSource.
      public final synchronized void parseDTD (
           InputStream in,
           String rootName);
  | Parses from a givenInputStream. The base URL should be set for resolving external entities and DTD.
      public final synchronized void parseDTD (
            Reader in,
            String rootName);
  | Parses from a given Reader. The base URL should be set for resolving external entities and DTD.
      public final synchronized void parseDTD (
           String urlName,
           String rootName);
  | Parses from the URL indicated.
      public final synchronized void parseDTD (
           URL url,
           String rootName);
  | Parses the XML External DTD document pointed to by the given URL and creates the corresponding XML document hierarchy.

  Parameter | Description
  --- | ---
      in
  | The input to parse.
      rootName
  | The element to be used as root element.
      r
  | The Reader containing XML data to parse.
      urlName
  | The String containing the URL from which to parse.
      utl
  | The ULR that points to the XML document to parse.

## removeDOMBuilderErrorListener()

Removes DOMBuilderErrorListener.

#### Syntax

    public synchronized void removeDOMBuilderErrorListener(
                        DOMBuilderErrorListener p0);

Parameter | Description
--- | ---
    po
| The DOMBuilderErrorListener to remove.

## removeDOMBuilderListener()

Removes DOMBuilderListener.

#### Syntax

    public synchronized void removeDOMBuilderListener(
                        DOMBuilderListener p0);

Parameter | Description
--- | ---
    p1
| The DOMBuilderListener to remove.

## run()

This method runs in a thread. It is specified in java.lang.Runnable.run() in interface java.lang.Runnable.

#### Syntax

    public void run();

## setBaseURL()

Sets the base URL for loading external entities and DTDs. This method should to be called if the parse(InputStream) option is used to parse the XML Document.

#### Syntax

    public synchronized void setBaseURL( java.net.URL url);

Parameter | Description
--- | ---
    url
| The base URL.

## setDebugMode()

Sets a flag to turn on debug information in the document.

#### Syntax

    public void setDebugMode(boolean flag);

Parameter | Description
--- | ---
    flag
| Determines whether debug information is stored; `TRUE` when stored.

## setDoctype()

Sets the DTD.

#### Syntax

    public synchronized void setDoctype(oracle.xml.async.DTD dtd)

Parameter | Description
--- | ---
    dtd
| The DTD to set and use while parsing.

## setErrorStream()

Creates an output stream for errors and warnings. If an output stream for errors is not specified, the parser will use the standard error output stream System.err for outputting errors and warnings. The options are described in the following table.

Syntax | Description
--- | ---
    public final synchronized void setErrorStream(
         OutputStream out);
| Uses OutputSteam.
    public final synchronized void setErrorStream(
         OutputStream out,
         String enc);
| Uses OutputSteam. An `IOException` is thrown if the encoding specified is not supported.
    public final synchronized void setErrorStream(
         PrintWriter out);
| Uses PrintWriter.

Parameter | Description
--- | ---
    out
    The the output for errors and warnings.
    enc
    The encoding to use.

## setNodeFactory()

Sets the node factory. Applications can extend the NodeFactory and register it through this method. The parser will then use the user supplied NodeFactory to create nodes of the DOM tree. Throws `XMLParseException` when using an invalid factory.

#### Syntax

    public synchronized void setNodeFactory(
                        oracle.xml.async.NodeFactory factory);

Parameter | Description
--- | ---
    factory
| The NodeFactory to set.

## setPreserveWhitespace()

Sets the white space preservation mode.

#### Syntax

    public synchronized void setPreserveWhitespace( boolean flag);

Parameter | Description
--- | ---
    flag
| The preserving mode; `TRUE` to preserve whitespace, `FALSE` otherwise.

## setValidationMode()

Sets the validation mode.

#### Syntax

    public synchronized void setValidationMode(boolean yes);

Parameter | Description
--- | ---
    yes
| Determines whether XML parser should be validating; `TRUE` for validation.

## showWarnings()

Determines whether to print warnings.

#### Syntax

    public synchronized void showWarnings(boolean yes);

Parameter | Description
--- | ---
    yes
| Switch; `TRUE` to print warnings, `FALSE` otherwise.

## DOMBuilderBeanInfo Class

This class provides information about the DOMBuilder Bean.

#### Syntax

    public class DOMBuilderBeanInfo extends java.beans.SimpleBeanInfo

##### Table 10-4 Summary of Methods of DOMBuilderBeanInfo

Method | Description
--- | ---
DOMBuilderBeanInfo() | The default constructor.
getIcon() | Gets an image object that can be used to represent the DOMBuilder bean in toolbars, and so on.
getPropertyDescriptors() | Retrieves the array of DOMBuilder bean's editable PropertyDescriptiors.

## DOMBuilderBeanInfo()

The default constructor.

#### Syntax

    public  DOMBuilderBeanInfo();

## getIcon()

Gets an image object that can be used to represent the DOMBuilder bean in toolbars, toolboxes, and so on. Returns an image object representing the requested icon type.

#### Syntax

    public java.awt.Image getIcon( int iconKind);

Parameter | Description
--- | ---
    iconKind
| The kind of icon requested.

## getPropertyDescriptors()

Retrieves the array of DOMBuilder bean's editable PropertyDescriptiors.

#### Syntax

    public java.beans.PropertyDescriptor[] getPropertyDescriptors();

## DOMBuilderErrorEvent Class

This class defines the error event which is sent when parse exception occurs.

#### Syntax

    public class DOMBuilderErrorEvent extends java.util.EventObject

##### Table 10-5 Fields of DOMBuilderErrorEvent

Field | Syntax | Description
--- | --- | ---
    e
    protected
    java.lang.Exception
| The exception being raised.

## DOMBuilderErrorEvent()

Constructor for DOMBuilderErrorEvent.

#### Syntax

    public  DOMBuilderErrorEvent( Object p0,
                                  Exception e);

Parameter | Description
--- | ---
    p0
| The Object that created this error event.
    e
| The Exception being raised.

## getException()

Retrieves the exception being raised.

#### Syntax

    public java.lang.Exception getException();

## getMessage()

Returns the error message generated by the parser, as a String.

#### Syntax

    public java.lang.String getMessage();

## DOMBuilderErrorListener Interface

This interface must be implemented in order to receive notifications when error is found during parsing. The class implementing this interface must be added to the DOMBuilder using addDOMBuilderErrorListener method.

#### Syntax

    public interface DOMBuilderErrorListener extends java.util.EventListener

## domBuilderErrorCalled()

This method is called when a parse error occurs.

#### Syntax

    public void domBuilderErrorCalled( DOMBuilderErrorEvent p0);

Parameter | Description
--- | ---
    p0
| The DOMBuilderErrorEvent object produced by the DOMBuilder as result of parsing error.

## DOMBuilderEvent Class

The event object that DOMBuilder uses to notify all registered listeners about parse events.

#### Syntax

    public class DOMBuilderEvent extends java.util.EventObject

##### Table 10-6 Fields of DOMBuilderEvent

Field | Syntax | Description
--- | --- | ---
    id
| protected int id | ID of the source DOMBuilder object

##### Table 10-7 Summary of Methods of DOMBuilderEvent

Method | Description
--- | ---
DOMBuilderEvent() | Creates a new DOMBuilderEvent.
getID() | Returns unique id of the source DOMBuilder for the event.

## DOMBuilderEvent()

Creates a new DOMBuilderEvent.

#### Syntax

    public  DOMBuilderEvent( Object p0, int p1);

Parameter | Description
--- | ---
    p0
| The Object creating this event.
    p1
| Id of the DOMBuilder creating this event.

## getID()

Returns unique id of the source DOMBuilder for this event, which can be used to identify which instance of the DOMBuilder generated this event in cases where multiple instances of DOMBuilder may be working in background.

#### Syntax

    public int getID();

## DOMBuilderListener Interface

This interface must be implemented in order to receive notifications about events during the asyncronous parsing. The class implementing this interface must be added to the DOMBuilder using addDOMBuilderListener method.

#### Syntax

    public interface DOMBuilderListener extends java.util.EventListener

##### Table 10-8 Summary of Methods of DOMBuilderListener

Method | Description
--- | ---
domBuilderError() | This method is called when parse error occur.
domBuilderOver() | This method is called when the parse is complete.
domBuilderStarted() | This method is called when parse starts

## domBuilderError()

This method is called when parse error occur.

#### Syntax

    public void domBuilderError( DOMBuilderEvent p0);

Parameter | Description
--- | ---
    p0
| The DOMBuilderEvent object produced by the DOMBuilder.

## domBuilderOver()

This method is called when the parse is complete.

#### Syntax

    public void domBuilderOver( DOMBuilderEvent p0);

Parameter | Description
--- | ---
    p0
| The DOMBuilderEvent object produced by the DOMBuilder.

## domBuilderStarted()

This method is called when parse starts.

#### Syntax

    public void domBuilderStarted( DOMBuilderEvent p0);

Parameter | Description
--- | ---
    p0
| The DOMBuilderEvent object produced by the DOMBuilder.

## ResourceManager Class

Implements a semaphore and maintains access to a fixed number of logical resources.

#### Syntax

    public class ResourceManager extends java.lang.Object

##### Table 10-9 Summary of Methods of ResourceManager

Method | Description
--- | ---
ResourceManager() | The ResourceManager constructor.
activeFound() | Checks if any of the logical resources being managed are in active use.
getResource() | If the number of resources available for use is nonzero, decreases the number of resources by one. Otherwise, waits until a resource is released and it becomes available for use.
releaseResource() | Releases a single resource, increasing the number of resources available.
sleep() | Allows use of Thread.sleep() without try/catch.

## ResourceManager()

The ResourceManager constructor.

#### Syntax

    public  ResourceManager(int i);

Parameter | Description
--- | ---
    i
| The number of resources to manage.

## activeFound()

Checks if any of the logical resources being managed are in active use. Returns `TRUE` if one or more resources in use, `FALSE` if no resources in use.

#### Syntax

    public boolean activeFound();

## getResource()

If the number of resources available for use is nonzero, the method decreases the number of resources by one. Otherwise, it waits until a resource is released and it becomes available for use.

#### Syntax

    public synchronized void getResource();

## releaseResource()

Releases a resource. When this method is called, the number of resources available is increased by one.

#### Syntax

    public void releaseResource();

## sleep()

Allows use of Thread.sleep() without try/catch.

#### Syntax

    public void sleep(int i);

Parameter | Description
--- | ---
    i
| The number of resources to manage.

## XSLTransformer Class

Applies XSL transformation in a background thread.

#### Syntax

    public class XSLTransformer extends java.lang.Object implements
         java.io.Serializable, oracle.xml.async.XSLTransformerConstants,
         java.lang.Runnable

    java.lang.Object

##### Table 10-10 Fields of XSLTransformer

Field | Syntax | Description
--- | --- | ---
    methodToCall
    protected int methodToCall
| The XSL transformation method to call based on input types.
    result
    protected
    oracle.xml.async.DocumentFragment result
| Transformation result document.

##### Table 10-11 Summary of Methods of XSLTransformer

Method | Description
--- | ---
XSLTransformer() | XSLTransformer class constructor.
addXSLTransformerErrorListener() | Adds and XSLTransformerErrorListener.
addXSLTransformerListener() | Adds and XSLTransformerListener.
getId() | Returns a unique XSLTransformer id.
getResult() | Returns the document fragment of the XSL transformation for the resulting document.
processXSL() | Initiates XSL Transformation in the background. The control is returned immediately.
removeDOMTransformerErrorListener() | Removes an XSLTransformerErrorListener.
removeXSLTransformerListener() | Removes an XSLTransformerListener.
run() | Starts a separate thread to perform the XSLTransformation.
setErrorStream() | Sets the error stream to be used by XML processor.
showWarnings() | Sets the showWarnings flag used by the XSL processor.

## XSLTransformer()

XSLTransformer constructor. The options are described in the following table.

Syntax | Description
--- | ---
    public
    XSLTransformer();
| XSLTransformer constructor.
    public XSLTransformer(
        int id);
| XSLTransformer constructor accepting an identifier.

Parameter | Description
--- | ---
    id
| Integer used to identify the XSLTransformer instance during event processing

## addXSLTransformerErrorListener()

Adds an XSLTransformerErrortListener.

#### Syntax

    public void addXSLTransformerErrorListener(
                        XSLTransformerErrorListerner p0);

Parameter | Description
--- | ---
    p0
| XSLTransformerErrorListener to be added.

## addXSLTransformerListener()

Adds a XSLTransformerListener.

#### Syntax

    public void addXSLTransformerListener( XSLTransformerListerner p0);

Parameter | Description
--- | ---
    p0
| XSLTransformerListener to be added.

## getId()

Returns the unique XSLTransformer id.

#### Syntax

    public int getId();

## getResult()

Returns the document fragment of the XSL transformation for the resulting document. Called only after receiving notification that the transformation is complete. Since the transformation occurs in background and asyncronously, calling this method immediately after `processXSL()` will result in holding the control until the result is available.

#### Syntax

    public synchronized oracle.xml.async.DocumentFragment getResult();

## processXSL()

Initiates XSL Transformation in the background. The control is returned immediately. An `XSLException` is thrown if an error occurs during XSL transformation. The options are described in the following table.

Syntax | Description
--- | ---
    public void processXSL(
         oracle.xml.async.XSLStylesheet xsl,
         InputStream xml,
         URL ref)
| The source XML document is provided as an InputStream.
    public void processXSL(
         oracle.xml.async.XSLStylesheet xsl, j
         Reader xml,
         URL ref);
| The source XML document is provided as a Reader.
    public void processXSL(
         oracle.xml.async.XSLStylesheet xsl,
         URL xml,
         URL ref);
| The source XML document is provided through a URL.
    public void processXSL(
         oracle.xml.async.XSLStylesheet xsl,
         oracle.xml.async.XMLDocument xml);
| The source XML document is provided as a DOM tree.
    public void processXSL(
         oracle.xml.async.XSLStylesheet xsl,
         oracle.xml.async.XMLDocument xml, j
         OutputStream os);
| The source XML document is provided as a DOM tree, and the output is written into an OutputStream.

Parameter | Description
--- | ---
    xsl
| The stylesheet to be used for XSL transformation
    xml
| The XML document to be used
    ref
| The reference URL to resolve external entities in input XML
    os
| Output to which the XSL transformation result is written

## removeDOMTransformerErrorListener()

Removes an XSLTransformerErrorListener.

#### Syntax

    public synchronized void removeDOMTransformerErrorListener(
                        XSLTransformerErrorListener p0);

Parameter | Description
--- | ---
    p0
| The XSLTransformerErrorListener to be removed.

## removeXSLTransformerListener()

Removes a XSLTransformerListener.

#### Syntax

    public synchronized void removeXSLTransformerListener(
                        XSLTransformerListener p0);

Parameter | Description
--- | ---
    p0
| The XSLTransformerListener to be removed.

## run()

Starts a separate thread to perform the XSLTransformation. Specified by java.lang.Runnable.run() in java.lang.Runnable Interface.

#### Syntax

    public void run();

## setErrorStream()

Sets the error stream used by the XSL processor.

#### Syntax

    public final void setErrorStream( java.io.OutputStream out);

Parameter | Description
--- | ---
    out
| The error output stream for the XSL processor.

## showWarnings()

Sets the showWarnings flag used by the XSL processor.

#### Syntax

    public final void showWarnings( boolean yes);

Parameter | Description
--- | ---
    yes
| Indicates whether XSL processor warnings should be shown; `TRUE` to show warnings, `FALSE` otherwise.

## XSLTransformerBeanInfo Class

This class provides information about the XSLTransformer Bean.

#### Syntax

    public class XSLTransformerBeanInfo extends java.beans.SimpleBeanInfo

##### Table 10-12 Summary of Methods of XSLTransformerBeanInfo

Method | Description
--- | ---
XSLTransformerBeanInfo() | The default constructor.
getIcon() | Retrieves an image representing the requested icon type.
getPropertyDescriptors() | Retrieves the array of XSLTransformer bean's editable PropertyDescriptiors.

## XSLTransformerBeanInfo()

The default Constructor.

#### Syntax

    public  XSLTransformerBeanInfo();

## getIcon()

Retrieves an image object representing the requested icon type for XSLTransformer bean in toolbars, toolboxes, and so on. Overrides `getIcon()` in `java.beans.SimpleBeanInfo` class.

#### Syntax

    public java.awt.Image getIcon( int iconKind);

Parameter | Description
--- | ---
    iconKind
| The kind of icon requested.

## getPropertyDescriptors()

Retrieves the array of XSLTransformer bean's editable PropertyDescriptiors. Overrides `getPropertyDescriptors()` in `java.beans.SimpleBeanInfo` class.

#### Syntax

    public java.beans.PropertyDescriptor[] getPropertyDescriptors();

## XSLTransformerErrorEvent Class

The error event object that XSLTransformer uses to notify all registered listeners about transformation error events.

#### Syntax

    public class XSLTransformerErrorEvent extends java.util.EventObject

##### Table 10-13 Fields of XSLTransformerErrorEvent

Field | Syntax | Description
--- | --- | ---
    e
    protected java.lang.Exception e
| The exception being raised.

##### Table 10-14 Summary of Methods of XSLTransformerErrorEvent

Method | Description
--- | ---
XSLTransformerErrorEvent() | Constructor for XSLTransformerErrorEvent.
getException() | Returns the transformation exception that XSLTransformer encountered an object unique id.
getMessage() | Returns the error message that describes the error encountered by XSLTransformer.

## XSLTransformerErrorEvent()

Constructor for XSLTransformerErrorEvent.

#### Syntax

    public  XSLTransformerErrorEvent( Object p0,
                                        Exception e);

Parameter | Description
--- | ---
    p0
| The Object that created this event.
    e
| The exception raised.

## getException()

Returns the transformation exception that XSLTransformer encountered an object unique id.

#### Syntax

    public Exception getException();

## getMessage()

Returns the error message that describes the error encountered by XSLTransformer.

#### Syntax

    public String getMessage();

## XSLTransformerErrorListener Interface

This interface must be implemented in order to receive notifications about error events during the asynchronous transformation. The class implementing this interface must be added to the XSLTransformer using addXSLTransformerListener method.

#### Syntax

    public interface XSLTransformerErrorListener extends
         java.util.EventListener

## xslTransformerErrorCalled()

his method is called when parse or transformation error occurs.

#### Syntax

    public void xslTransformerErrorCalled( XSLTransformerErrorEvent p0);

Parameter | Description
--- | ---
    p0
| The XSLTransformerErrorEvent object produced by the XSLTransformer.

## XSLTransformerEvent Class

This class represents the event object used by XSLTransformer to notify XSL transformation events to all its registered listeners.

#### Syntax

    public class XSLTransformerEvent extends java.util.EventObject

##### Table 10-15 Fields of XSLTransformerEvent

Field | Syntax | Description
--- | --- | ---
id | protected int id | ID of the source XSLTransformer object

##### Table 10-16 Summary of Methods of XSLTransformerEvent

Method | Description
--- | ---
XSLTransformerEvent() | Constructs the XSLTransformerEvent object using the XSLTransformer source object and its unique id.
getID() | Returns unique id of the XSLTransformer object

## XSLTransformerEvent()

Constructs the XSLTransformerEvent object using the XSLTransformer source object and its unique id.

#### Syntax

    public  XSLTransformerEvent(java.lang.Object p0, int p1);

Parameter | Description
--- | ---
    p0
| The source XSLTransformer object that will fire the events
    p1
| Unique id identifying the source object

## getID()

Returns unique id of the XSLTransformer object which can be used to identify which instance of the XSLTransformer generated this event in cases where multiple instances of XSLTransformer may be working in background.

#### Syntax

    public int getID();

## XSLTransformerListener Interface

Implemented to receive notifications of events during asynchronous transform. The implementing class must be added using addXSLTransformerListener method.

#### Syntax

    public interface XSLTransformerListener extends java.util.EventListener

## xslTransformerError()

This method is called when parse or transformation error occur.

#### Syntax

    public void xslTransformerError( XSLTransformerEvent p0);

Parameter | Description
--- | ---
    p0
| The XSLTransformerEvent object produced by the XSLTransformer.

## xslTransformerOver()

This method is called when the transformation is complete.

#### Syntax

    public void xslTransformerOver( XSLTransformerEvent p0);

Parameter | Description
--- | ---
    p0
| The XSLTransformerEvent object produced by the XSLTransformer.

## xslTransformerStarted()

This method is called when the transformation starts.

#### Syntax

    public void xslTransformerStarted( XSLTransformerEvent p0);

Parameter | Description
--- | ---
    p0
| The XSLTransformerEvent object produced by the XSLTransformer.

## oracle.xml.dbviewer Package

This is a visual bean used to display and edit HTML, XML or XSL file. XML files can be transferred between the file system, the database and the bean buffers. It can be used to transform database queries to XML. XML files can be parsed and transformed using XSL. The classes of the o`racle.xml.dbviewer` as summarized in Table 10-17.

##### Table 10-17 Summary of Classes of oracle.xml.dbviewer

Class | Description
--- | ---
DBViewer Class | Java bean that can be used to display database queries or any XML by applying XSL stylesheets and visualizing the resulting HTML in a scrollable swing panel.
DBViewerBeanInfo Class | This class provides information about the DBViewer Bean.

## DBViewer Class

Java bean that can be used to display database queries or any XML by applying XSL stylesheets and visualizing the resulting HTML in a scrollable swing panel. This bean has tree buffers: XML, XSL and result buffer. The bean API enables the calling program to load/save the buffers from various sources and to apply stylesheet transformations to the XML buffer using the stylesheet in the XSL buffer. The result can be stored in the result buffer.

The XML and XSL buffer content can be shown as source or as a tree structures. The result buffer content can be rendered as HTML, and also shown as source or tree structures. The XML buffer can be loaded from database query.

All buffers can load and save files both from CLOB tables in Oracle database and from the file system. Therefore, the control can be used to move files between the file system and the user schema in the database.

#### Syntax

    public class DBViewer extends javax.swing.JPanel implements java.io.Serializable

##### Table 10-18 Summary of Methods of DBViewer

Method | Description
--- | ---
DBViewer() | Constructs a new instance of DBViewer.
getHostname() | Retrieves the database host name.
getInstancename() | Retrieves the database instance name.
getPassword() | Retrieves the user password.
getPort() | Retrieves the database port number as a String.
getResBuffer() | Retrieves the content of the result buffer.
getResCLOBFileName() | Retrieves the result CLOB file name.
getResCLOBTableName() | Retrieves the result CLOB table name.
getResFileName() | Retrieves the result file name.
getUsername() | Retrieves the user name.
getXmlBuffer() | Retrieves the content of the XML buffer.
getXmlCLOBFileName() | Retrieves the XML CLOB file name.
getXmlCLOBTableName() | Retrieves the XML CLOB table name.
getXmlFileName() | Retrieves the XML file name.
getXMLStringFromSQL() | Retrieves the XML presentation of a result set from SQL query as an XMLString.
getXslBuffer() | Retrieves the content of the XSL buffer.
getXslCLOBFileName() | Retrieves the XSL CLOB file name.
getXslCLOBTableName() | Retrieves XSL CLOB table name.
getXslFileName() | Retrieves XSL file name.
loadResBuffer() | Loads the result buffer.
loadResBufferFromClob() | Loads the result buffer from CLOB file.
loadResBufferFromFile() | Loads the result buffer from file.
loadXmlBuffer() | Loads the XML buffer.
loadXmlBufferFromClob() | Loads the XML buffer from CLOB file.
loadXmlBufferFromFile() | Loads the XML buffer from file.
loadXMLBufferFromSQL() | Loads the XML buffer from SQL result set.
loadXslBuffer() | Loads the XSL buffer from file.
loadXslBufferFromClob() | Loads the XSL buffer from CLOB file.
loadXslBufferFromFile() | Loads the XSL buffer from file.
parseResBuffer() | Parses the result buffer, refreshes the tree and source views, and returns the XMLDocument.
parseXmlBuffer() | Parse the XML buffer, refreshes the tree and source views, and returns the XMLDocument.
parseXslBuffer() | Parses the XSL buffer, refreshes the tree and source views, and returns the XMLDocument.
saveResBuffer() | Saves the result buffer to file.
saveResBufferToClob() | Saves the result buffer to CLOB file.
saveResBufferToFile() | Saves the result buffer to file.
saveXmlBuffer() | Saves the XML buffer to file.
saveXmlBufferToClob() | Saves the XML buffer to CLOB file.
saveXmlBufferToFile() | Saves the XML buffer to file.
saveXslBuffer() | Saves the XSL buffer to file.
saveXslBufferToClob() | Saves the XSL buffer to CLOB file.
saveXslBufferToFile() | Saves the XSL buffer to file.
setHostname() | Sets database host name.
setInstancename() | Sets database instance name.
setPassword() | Sets user password.
setPort() | Sets database port number.
setResBuffer() | Sets new text in the result buffer.
setResCLOBFileName() | Sets result CLOB file name.
setResCLOBTableName() | Sets result CLOB table name.
setResFileName() | Sets result file name.
setResHtmlView() | Show the result buffer as rendered HTML.
setResSourceEditView() | Shows the result buffer as XML source and enter edit mode.
setResSourceView() | Shows the result buffer as XML source.
setResTreeView() | Shows the result buffer as an XML tree view.
setUsername() | Sets the user name.
setXmlBuffer() | Sets new text in the XML buffer.
setXmlCLOBFileName() | Sets XML CLOB file name.
setXmlCLOBTableName() | Sets the XML CLOB table name.
setXmlFileName() | Sets the XML file name.
setXmlSourceEditView() | Shows the XML buffer as XML source and enter edit mode.
setXmlSourceView() | Shows the XML buffer as an XML source.
setXmlTreeView() | Shows the XML buffer as tree.
setXslBuffer() | Sets new text in the XSL buffer.
setXslCLOBFileName() | Sets the XSL CLOB file name.
setXslCLOBTableName() | Sets the XSL CLOB table name.
setXslFileName() | Sets the XSL file name.
setXslSourceEditView() | Shows the XSL buffer as XML source and enter edit mode.
setXslSourceView() | Shows the XSL buffer as an XML source.
setXslTreeView() | Shows the XSL buffer as tree.
transformToDoc() | Transforms the content of the XML buffer by applying the stylesheet from the XSL buffer.
transformToRes() | Applies the stylesheet transformation from the XSL buffer to the XML in the XML buffer, and stores the result in the result buffer.
transformToString() | Transforms the content of the XML buffer by applying the stylesheet from the XSL buffer.

## DBViewer()

Constructs a new instance of DBViewer.

#### Syntax

    public  DBViewer();

## getHostname()

Retrieves the database host name.

#### Syntax

    public java.lang.String getHostname();

## getInstancename()

Retrieves the database instance name.

#### Syntax

    public java.lang.String getInstancename();

## getPassword()

Retrieves the user password.

#### Syntax

    public java.lang.String getPassword();

## getPort()

Retrieves the database port number as a String.

#### Syntax

    public java.lang.String getPort();

## getResBuffer()

Retrieves the content of the result buffer.

#### Syntax

    public java.lang.String getResBuffer();

## getResCLOBFileName()

Retrieves the result CLOB file name.

#### Syntax

    public java.lang.String getResCLOBFileName();

## getResCLOBTableName()

Retrieves the result CLOB table name.

#### Syntax

    public java.lang.String getResCLOBTableName();

## getResFileName()

Retrieves the result file name.

#### Syntax

    public java.lang.String getResFileName();

## getUsername()

Retrieves the user name.

#### Syntax

    public java.lang.String getUsername();

## getXmlBuffer()

Retrieves the content of the XML buffer.

#### Syntax

    public java.lang.String getXmlBuffer();

## getXmlCLOBFileName()

Retrieves the XML CLOB file name.

#### Syntax

    public java.lang.String getXmlCLOBFileName();

## getXmlCLOBTableName()

Retrieves the XML CLOB table name.

#### Syntax

    public java.lang.String getXmlCLOBTableName();

## getXmlFileName()

Retrieves the XML file name.

#### Syntax

    public java.lang.String getXmlFileName();

## getXMLStringFromSQL()

Retrieves the XML presentation of a result set from SQL query as an XMLString.

#### Syntax

    public java.lang.String getXMLStringFromSQL( java.lang.String sqlText);

Parameter | Description
--- | ---
    sqlText
| The SQL text.

## getXslBuffer()

Retrieves the content of the XSL buffer.

#### Syntax

    public java.lang.String getXslBuffer();

## getXslCLOBFileName()

Retrieves the XSL CLOB file name.

#### Syntax

    public java.lang.String getXslCLOBFileName();

## getXslCLOBTableName()

Retrieves XSL CLOB table name.

#### Syntax

    public java.lang.String getXslCLOBTableName();

## getXslFileName()

Retrieves XSL file name.

#### Syntax

    public java.lang.String getXslFileName();

## loadResBuffer()

Loads the result buffer. The options are described in the following table.

Syntax | Description
--- | ---
    public void loadResBuffer(
         String filename);
| Loads the result buffer from file.
    public void loadResBuffer(
         String clobTablename,
         String clobFilename);
| Loads the result buffer from a CLOB file.
    public void loadResBuffer(
         oracle.xml.parser.v2.XMLDocument resDoc);
| Loads the result buffer from an XMLDocument.

Parameter | Description
--- | ---
    filename
| The file name.
    clobTablename
| The CLOB table name.
    clobFilename
| The CLOB file name.
    resDoc
| The XMLDocument.

## loadResBufferFromClob()

Loads the result buffer from CLOB file.

#### Syntax

    public void loadResBufferFromClob();

## loadResBufferFromFile()

Loads the result buffer from file.

#### Syntax

    public void loadResBufferFromFile();

## loadXmlBuffer()

Loads the XML buffer. The options are described in the following table.

Syntax | Description
--- | ---
    public void loadXmlBuffer( j
         String filename);
| Loads the XML buffer from file.
    public void loadXmlBuffer(
         String clobTablename,
         String clobFilename);
| Loads the XML buffer from CLOB file.
    public void loadXmlBuffer(
         oracle.xml.parser.v2.XMLDocument xmlDoc);
| Loads the XML buffer from XMLDocument.

Parameter | Description
--- | ---
    filename
| The file name.
    clobTablename
| The CLOB table name.
    clobFilename
| The CLOB file name.
    resDoc
| The XMLDocument.

## loadXmlBufferFromClob()

Loads the XML buffer from CLOB file.

#### Syntax

    public void loadXmlBufferFromClob();

## loadXmlBufferFromFile()

Loads the XML buffer from file.

#### Syntax

    public void loadXmlBufferFromFile();

## loadXMLBufferFromSQL()

Loads the XML buffer from SQL result set.

#### Syntax

    public void loadXMLBufferFromSQL( String sqlText);

Parameter | Description
--- | ---
    sqlText
| SQL text

## loadXslBuffer()

Loads the XSL buffer from file. The options are described in the following table.

Syntax | Description
--- | ---
    public void loadXslBuffer(
         String filename);
| Loads the XSL buffer from file.
    public void loadXslBuffer(
         String clobTablename,
         String clobFilename);
| Loads the XSL buffer from CLOB file.
    public void loadXslBuffer(
         oracle.xml.parser.v2.XMLDocument xslDoc);
| Loads the XSL buffer from XMLDocument.

Parameter | Description
--- | ---
    filename
| The file name.
    clobTablename
| The CLOB table name.
    clobFilename
| The CLOB file name.
    xslDoc
| The XMLDocument.

## loadXslBufferFromClob()

Loads the XSL buffer from CLOB file.

#### Syntax

    public void loadXslBufferFromClob();

## loadXslBufferFromFile()

Loads the XSL buffer from file.

#### Syntax

    public void loadXslBufferFromFile();

## parseResBuffer()

Parses the result buffer, refreshes the tree and source views, and returns the XMLDocument.

#### Syntax

    public oracle.xml.parser.v2.XMLDocument parseResBuffer();

## parseXmlBuffer()

Parse the XML buffer, refreshes the tree and source views, and returns the XMLDocument.

#### Syntax

    public oracle.xml.parser.v2.XMLDocument parseXmlBuffer();

## parseXslBuffer()

Parses the XSL buffer, refreshes the tree and source views, and returns the XMLDocument.

#### Syntax

    public oracle.xml.parser.v2.XMLDocument parseXslBuffer();

## saveResBuffer()

Saves the result buffer to file. The options are described in the following table.

Syntax | Description
--- | ---
    public void saveResBuffer(
         String filename);
| Save the result buffer to file.
    public void saveResBuffer(
         String tablename,
         String filename);
| Save the result buffer to CLOB file.

Parameter | Description
--- | ---
    tablename
| The CLOB table name.
    filename
| The CLOB file name.

## saveResBufferToClob()

Saves the result buffer to CLOB file.

#### Syntax

    public void saveResBufferToClob();

## saveResBufferToFile()

Saves the result buffer to file.

#### Syntax

    public void saveResBufferToFile();

## saveXmlBuffer()

Saves the XML buffer to file. The options are described in the following table.

Syntax | Description
--- | ---
    public void saveXmlBuffer(
         String filename);
| Saves the XML buffer to file.
    public void saveXmlBuffer(
         String tablename,
         String filename);
| Saves the XML buffer to CLOB file.

Parameter | Description
--- | ---
    tablename
| The CLOB table name.
    filename
| The CLOB file name.

## saveXmlBufferToClob()

Saves the XML buffer to CLOB file.

#### Syntax

    public void saveXmlBufferToClob();

## saveXmlBufferToFile()

Saves the XML buffer to file.

#### Syntax

    public void saveXmlBufferToFile();

## saveXslBuffer()

Saves the XSL buffer to file. The options are described in the following table.

Syntax | Description
--- | ---
    public void saveXslBuffer(
         String fileName);
| Saves the XSL buffer to file in the file system.
    public void saveXslBuffer(
         String tableName,
         String fileName);
| Saves the XSL buffer to a CLOB file.

Parameter | Description
--- | ---
    tableName
| The table name.
    fileName
| The file name.

## saveXslBufferToClob()

Saves the XSL buffer to CLOB file.

#### Syntax

    public void saveXslBufferToClob();

## saveXslBufferToFile()

Saves the XSL buffer to file.

#### Syntax

    public void saveXslBufferToFile();

## setHostname()

Sets database host name.

#### Syntax

    public void setHostname( java.lang.String hostname);

Parameter | Description
--- | ---
    hostname
| The host name.

## setInstancename()

Sets database instance name.

#### Syntax

    public void setInstancename( String instancename);

Parameter | Description
--- | ---
    instancename
| The database instance name.

## setPassword()

Sets user password.

#### Syntax

    public void setPassword( String password);

Parameter | Description
--- | ---
    password
| The user password.

## setPort()

Sets database port number.

#### Syntax

    public void setPort( String port);

Parameter | Description
--- | ---
    port
| String containing the port number.

## setResBuffer()

Sets new text in the result buffer.

#### Syntax

    public void setResBuffer( String text);

Parameter | Description
--- | ---
    text
| The new text.

## setResCLOBFileName()

Sets result CLOB file name.

#### Syntax

    public void setResCLOBFileName( String name);

Parameter | Description
--- | ---
    name
| Result CLOB file name.

## setResCLOBTableName()

Sets result CLOB table name.

#### Syntax

    public void setResCLOBTableName( String name);

Parameter | Description
--- | ---
    name
| Result CLOB table name.

## setResFileName()

Sets result file name.

#### Syntax

    public void setResFileName( String name);

Parameter | Description
--- | ---
    name
| Result file name.

## setResHtmlView()

Show the result buffer as rendered HTML.

#### Syntax

    public void setResHtmlView( boolean on);

Parameter | Description
--- | ---
    on
| Switch to show result buffer a HTML; `TRUE` to show, `FALSE` otherwise.

## setResSourceEditView()

Shows the result buffer as XML source and enter edit mode.

#### Syntax

    public void setResSourceEditView( boolean on);

Parameter | Description
--- | ---
    on
| Switch to show result buffer as HTML with edit mode; `TRUE` to show.

## setResSourceView()

Shows the result buffer as XML source.

#### Syntax

    public void setResSourceView( boolean on);

Parameter | Description
--- | ---
    on
| Switch to show result buffer as XML source; `TRUE` to show, `FALSE` otherwise.

## setResTreeView()

Shows the result buffer as an XML tree view.

#### Syntax

    public void setResTreeView( boolean on);

Parameter | Description
--- | ---
    on
| Switch to show result buffer as XML tree; `TRUE` to show, `FALSE` otherwise.

## setUsername()

Sets the user name.

#### Syntax

    public void setUsername( String username);

Parameter | Description
--- | ---
    username
| The user name.

## setXmlBuffer()

Sets new text in the XML buffer.

#### Syntax

    public void setXmlBuffer( String text)

Parameter | Description
--- | ---
    text
| The XML text

## setXmlCLOBFileName()

Sets XML CLOB file name.

#### Syntax

    public void setXmlCLOBFileName( String name);

Parameter | Description
--- | ---
    name
| The XML CLOB file name.

## setXmlCLOBTableName()

Sets the XML CLOB table name.

#### Syntax

    public void setXmlCLOBTableName( String name);

Parameter | Description
--- | ---
    name
| The XML CLOB table name.

## setXmlFileName()

Sets the XML file name.

#### Syntax

    public void setXmlFileName( String name);

Parameter | Description
--- | ---
    name
| The XML file name.

## setXmlSourceEditView()

Shows the XML buffer as XML source and enter edit mode.

#### Syntax

    public void setXmlSourceEditView( boolean on);

Parameter | Description
--- | ---
    on
| Switch to show XML buffer as XML source with edit mode; `TRUE` to show.

## setXmlSourceView()

Shows the XML buffer as an XML source.

#### Syntax

    public void setXmlSourceView( boolean on);

Parameter | Description
--- | ---
    on
| Switch to show XML buffer as XML source; `TRUE` to show, `FALSE` otherwise.

## setXmlTreeView()

Shows the XML buffer as tree.

#### Syntax

    public void setXmlTreeView( boolean on);

Parameter | Description
--- | ---
    on
| Switch to show XML buffer as XML tree; `TRUE` to show, `FALSE` otherwise.

## setXslBuffer()

Sets new text in the XSL buffer.

#### Syntax

    public void setXslBuffer( String text);

Parameter | Description
--- | ---
    text
| The XSL text.

## setXslCLOBFileName()

Sets the XSL CLOB file name.

#### Syntax

    public void setXslCLOBFileName( String name);

Parameter | Description
--- | ---
    name
| The XSL CLOB file name.

## setXslCLOBTableName()

Sets the XSL CLOB table name.

#### Syntax

    public void setXslCLOBTableName( String name);

Parameter | Description
--- | ---
    name
| The XSL CLOB table name.

## setXslFileName()

Sets the XSL file name.

#### Syntax

    public void setXslFileName( String name);

Parameter | Description
--- | ---
    name
| The XSL file name.

## setXslSourceEditView()

Shows the XSL buffer as XML source and enter edit mode.

#### Syntax

    public void setXslSourceEditView( boolean on);

Parameter | Description
--- | ---
    on
| Switch to show XSL buffer as XML source with edit mode; `TRUE` to show.

## setXslSourceView()

Shows the XSL buffer as an XML source.

#### Syntax

    public void setXslSourceView( boolean on);

Parameter | Description
--- | ---
    on
| Switch to show XSL buffer as XML source; `TRUE` to show, `FALSE` otherwise.

## setXslTreeView()

Shows the XSL buffer as tree.

#### Syntax

    public void setXslTreeView( boolean on);

Parameter | Description
--- | ---
    on
| Switch to show the XSL buffer as XML tree; `TRUE` to show, `FALSE` otherwise.

## transformToDoc()

Transforms the content of the XML buffer by applying the stylesheet from the XSL buffer.

#### Syntax

    public oracle.xml.parser.v2.XMLDocument transformToDoc();

## transformToRes()

Applies the stylesheet transformation from the XSL buffer to the XML in the XML buffer, and stores the result in the result buffer.

#### Syntax

    public void transformToRes();

## transformToString()

Transfroms the content of the XML buffer by applying the stylesheet from the XSL buffer.

#### Syntax

    public java.lang.String transformToString();

## DBViewerBeanInfo Class

This class provides information about the DBViewer Bean.

#### Syntax

    public class DBViewerBeanInfo extends java.beans.SimpleBeanInfo

    java.lang.Object

##### Table 10-19 Summary of Methods of DBViewerBeanInfo

Method | Description
--- | ---
DBViewerBeanInfo() | Class constructor.
getIcon() | Retrieves an image of the requested icon type.
getPropertyDescriptors() | Retrieves an array of DBViwer bean's editable PropertyDescriptors.

## DBViewerBeanInfo()

Class constructor.

#### Syntax

    public  DBViewerBeanInfo();

## getIcon()

Retrieves an image object representing the requested icon type for DBViewer bean in toolbars, toolboxes, and so on.

#### Syntax

    public java.awt.Image getIcon( int iconKind);

Parameter | Description
--- | ---
    iconKind
| The kind of icon requested.

## getPropertyDescriptors()

Retrieves an array of DBViwer bean's editable PropertyDescriptors.

#### Syntax

    public java.beans.PropertyDescriptor[] getPropertyDescriptors();

## oracle.xml.srcviewer Package

This is a visual bean used to display an XML source document with syntax highlighting. The color, fonts and sizes of different XML language element are customizable.

The classes of the o`racle.xml.srcviewer` as summarized in Table 10-20.

##### Table 10-20 Summary of Classes of oracle.xml.srcviewer

Class | Description
--- | ---
XMLSourceView Class | Shows an XML document.
XMLSourceViewBeanInfo Class | This class provides information about the XMLSourceView Bean.

## XMLSourceView Class

Shows an XML document. Recognizes the following XML token types: Tag, Attribute Name, Attribute Value, Comment, CDATA, PCDATA, PI Data, PI Name and NOTATION Symbol. Each token type has a foreground color and font. The default color/font settings can be changed by the user. Takes as input an org.w3c.dom.Document object.

#### Syntax

    public class XMLSourceView extends javax.swing.JPanel implements
    java.io.Serializable

##### Table 10-21 Fields of ElementDecl

Field | Syntax | Description
--- | --- | ---
    inputDOMDocument
    protected org.w3c.dom.Document
     inputDOMDocument
| XML Document to be displayed.
    jScrollPane
    protected
     javax.swing.JScrollPane jScrollPane
| The java swing component used by XMLSourveView to enable scrolling.
    jTextPane
    protected
     javax.swing.JTextPane jTextPane
| The java swing component used by XMLSourceView to display text.
    xmlStyledDocument
    protected
     oracle.xml.srcviewer.XMLStyledDocument
     xmlStyledDocument
| Represents a stylized XML document; associates XML tokens with attributes, such as font and color.

##### Table 10-22 Summary of Methods of XMLSourceView

Method | Description
--- | ---
XMLSourceView() | The class constructor. Creates an object of type XMLSourceView.
fontGet() | Extracts and returns the font from a given attribute set.
fontSet() | Sets the mutable attribute set font.
getAttributeNameFont() | Returns the Attribute Value font.
getAttributeNameForeground() | Returns the Attribute Name foreground color.
getAttributeValueFont() | Returns the Attribute Value font.
getAttributeValueForeground() | Returns the Attribute Value foreground color.
getBackground() | Returns the background color.
getCDATAFont() | Returns the CDATA font.
getCDATAForeground() | Returns the CDATA foreground color.
;getCommentDataFont() | Returns the Comment Data font.
getCommentDataForeground() | Returns the Comment Data foreground color.
getEditedText() | Returns the edited text.
getJTextPane() | Returns the viewer`JTextPane` component used by XMLSourceViewer.
getMinimumSize() | Returns the XMLSourceView minimal size.
getNodeAtOffset() | Returns the XML node at a given offset.
getPCDATAFont() | Returns the PCDATA font.
getPCDATAForeground() | Returns the PCDATA foreground color.
getPIDataFont() | Returns the PI Data font.
getPIDataForeground() | Returns the PI Data foreground color.
getPINameFont() | Returns the PI Name font.
getPINameForeground() | Returns the PI Data foreground color.
getSymbolFont() | Returns the NOTATION Symbol font.
getSymbolForeground() | Returns the NOTATION Symbol foreground color.
getTagFont() | Returns the Tag font.
getTagForeground() | Returns the Tag foreground color.
getText() | Returns the XML document as a String.
isEditable() | Returns boolean to indicate whether this object is editable.
selectNodeAt() | Moves the cursor to XML Node at specified offset.
setAttributeNameFont() | Sets the Attribute Name font.
setAttributeNameForeground() | Sets the Attribute Name foreground color.
setAttributeValueFont() | Sets the Attribute Value font.
setAttributeValueForeground() | Sets the Attribute Value foreground color.
setBackground() | Sets the background color.
setCDATAFont() | Sets the CDATA font.
setCDATAForeground() | Sets the CDATA foreground color.
setCommentDataFont() | Sets the Comment font.
setCommentDataForeground() | Sets the Comment foreground color.
setEditable() | Sets the specified boolean to indicate whether this object should be editable.
setPCDATAFont() | Sets the PCDATA font.
setPCDATAForeground() | Sets the PCDATA foreground color.
setPIDataFont() | Sets the PI Data font.
setPIDataForeground() | Sets the PI Data foreground color.
setPINameFont() | Sets the PI Name font.
setPINameForeground() | Sets the PI Name foreground color.
setSelectedNode() | Sets the cursor position at the selected XML node.
setSymbolFont() | Sets the NOTATION Symbol font.
setSymbolForeground() | Sets the NOTATION Symbol foreground color.
setTagFont() | Sets the Tag font.
setTagForeground() | Sets the Tag foreground color.
setXMLDocument() | Associates the XMLviewer with a XML document.

## XMLSourceView()

The class constructor. Creates an object of type XMLSourceView.

#### Syntax

    public  XMLSourceView();

## fontGet()

Extracts and returns the font from a given attribute set.

#### Syntax

    public static java.awt.Font fontGet(
                        javax.swing.text.AttributeSet attributeSet);

Parameter | Description
--- | ---
    attributeSet
| The source AttributeSet.

## fontSet()

Sets the mutable attribute set font.

#### Syntax

    public static void fontSet(
                        javax.swing.text.MutableAttributeSet mutAttributeSet,
                        java.awt.Font font);

Parameter | Description
--- | ---
    mutAttributeSet
| The mutableattributeset to update.
    font
| The new Font for the mutableattributeset.

## getAttributeNameFont()

Returns the Attribute Value font.

#### Syntax

    public java.awt.Font getAttributeNameFont();

## getAttributeNameForeground()

Returns the Attribute Name foreground color.

#### Syntax

    public java.awt.Color getAttributeNameForeground();

## getAttributeValueFont()

Returns the Attribute Value font.

#### Syntax

    public java.awt.Font getAttributeValueFont();

## getAttributeValueForeground()

Returns the Attribute Value foreground color.

#### Syntax

    public java.awt.Color getAttributeValueForeground();

## getBackground()

Returns the background color. Overrides getBackground() in java.awt.Component class.

#### Syntax

    public java.awt.Color getBackground();

## getCDATAFont()

Returns the CDATA font.

#### Syntax

    public java.awt.Font getCDATAFont();

## getCDATAForeground()

Returns the CDATA foreground color.

#### Syntax

    public java.awt.Color getCDATAForeground();

## ;getCommentDataFont()

Returns the Comment Data font.

#### Syntax

    public java.awt.Font getCommentDataFont();

## getCommentDataForeground()

Returns the Comment Data foreground color.

#### Syntax

    public java.awt.Color getCommentDataForeground();

## getEditedText()

Returns the edited text.

#### Syntax

    public java.lang.String getEditedText();

## getJTextPane()

Returns the viewer`JTextPane` component used by XMLSourceViewer.

#### Syntax

    public javax.swing.JTextPane getJTextPane();

## getMinimumSize()

Returns the XMLSourceView minimal size. Overrides getMinimumSize() in javax.swing.JComponent class.

#### Syntax

    public java.awt.Dimension getMinimumSize();

## getNodeAtOffset()

Returns the XML node at a given offset.

#### Syntax

    public org.w3c.dom.Node getNodeAtOffset( int i);

Parameter | Description
--- | ---
    i
| The node offset.

## getPCDATAFont()

Returns the PCDATA font.

#### Syntax

    public java.awt.Font getPCDATAFont();

## getPCDATAForeground()

Returns the PCDATA foreground color.

#### Syntax

    public java.awt.Color getPCDATAForeground();

## getPIDataFont()

Returns the PI Data font.

#### Syntax

    public java.awt.Font getPIDataFont();

## getPIDataForeground()

Returns the PI Data foreground color.

#### Syntax

    public java.awt.Color getPIDataForeground();

## getPINameFont()

Returns the PI Name font.

#### Syntax

    public java.awt.Font getPINameFont();

## getPINameForeground()

Returns the PI Data foreground color.

#### Syntax

    public java.awt.Color getPINameForeground();

## getSymbolFont()

Returns the NOTATION Symbol font.

#### Syntax

    public java.awt.Font getSymbolFont();

## getSymbolForeground()

Returns the NOTATION Symbol foreground color.

#### Syntax

    public java.awt.Color getSymbolForeground();

## getTagFont()

Returns the Tag font.

#### Syntax

    public java.awt.Font getTagFont();

## getTagForeground()

Returns the Tag foreground color.

#### Syntax

    public java.awt.Color getTagForeground();

## getText()

Returns the XML document as a String.

#### Syntax

    public java.lang.String getText();

## isEditable()

Returns boolean to indicate whether this object is editable.

#### Syntax

    public boolean isEditable();

## selectNodeAt()

Moves the cursor to XML Node at the specified offset.

#### Syntax

    public void selectNodeAt( int i);

Parameter | Description
--- | ---
    i
| The node offset.

## setAttributeNameFont()

Sets the Attribute Name font.

#### Syntax

    public void setAttributeNameFont( java.awt.Font font);

Parameter | Description
--- | ---
    font
| The new Font Attribute Name.

## setAttributeNameForeground()

Sets the Attribute Name foreground color.

#### Syntax

    public void setAttributeNameForeground( java.awt.Color color);

Parameter | Description
--- | ---
    color
| The new Color for Attribute Name.

## setAttributeValueFont()

Sets the Attribute Value font.

#### Syntax

    public void setAttributeValueFont( java.awt.Font font);

Parameter | Description
--- | ---
    font
| The new Font Attribute Value

## setAttributeValueForeground()

Sets the Attribute Value foreground color.

#### Syntax

    public void setAttributeValueForeground( java.awt.Color color);

Parameter | Description
--- | ---
    color
| The new Color for Attribute Value.

## setBackground()

Sets the background color. Overrides `setBackground()` in `javax.swing.JComponent` class.

#### Syntax

    public void setBackground( java.awt.Color color);

Parameter | Description
--- | ---
    font
| The new background Color.

## setCDATAFont()

Sets the CDATA font.

#### Syntax

    public void setCDATAFont( java.awt.Font font);

Parameter | Description
--- | ---
    font
| The new Font for CDATA.

## setCDATAForeground()

Sets the CDATA foreground color.

#### Syntax

    public void setCDATAForeground( java.awt.Color color);

Parameter | Description
--- | ---
    color
| The new Color for CDATA.

## setCommentDataFont()

Sets the Comment font.

#### Syntax

    public void setCommentDataFont( java.awt.Font font);

Parameter | Description
--- | ---
    font
| The new Font for the XML Comments.

## setCommentDataForeground()

Sets the Comment foreground color.

#### Syntax

    public void setCommentDataForeground( java.awt.Color color);

Parameter | Description
--- | ---
    color
| The new Color for Comment.

## setEditable()

Sets the specified boolean to indicate whether this object should be editable.

#### Syntax

    public void setEditable( boolean edit);

Parameter | Description
--- | ---
    edit
| Flag indicating if the object should be editable; `TRUE` when text displayed can be edited, `FALSE` otherwise.

## setPCDATAFont()

Sets the PCDATA font.

#### Syntax

    public void setPCDATAFont( java.awt.Font font);

Parameter | Description
--- | ---
    font
| The new Font for PCDATA.

## setPCDATAForeground()

Sets the PCDATA foreground color.

#### Syntax

    public void setPCDATAForeground( java.awt.Color color);

Parameter | Description
--- | ---
    color
| The new Color for PCDATA.

## setPIDataFont()

Sets the PI Data font.

#### Syntax

    public void setPIDataFont( java.awt.Font font);

Parameter | Description
--- | ---
    font
| The new Font for PI Data.

## setPIDataForeground()

Sets the PI Data foreground color.

#### Syntax

    public void setPIDataForeground( java.awt.Color color);

Parameter | Description
--- | ---
    color
| The new Color for PI Data.

## setPINameFont()

Sets the PI Name font.

#### Syntax

    public void setPINameFont(java.awt.Font font);

Parameter | Description
--- | ---
    font
| The new Font for the PI Names.

## setPINameForeground()

Sets the PI Name foreground color.

#### Syntax

    public void setPINameForeground( java.awt.Color color);

Parameter | Description
--- | ---
    color
| The new Color for PI Name.

## setSelectedNode()

Sets the cursor position at the selected XML node.

#### Syntax

    public void setSelectedNode( org.w3c.dom.Node node);

Parameter | Description
--- | ---
    node
| The selected node.

## setSymbolFont()

Sets the NOTATION Symbol font.

#### Syntax

    public void setSymbolFont( java.awt.Font font);

Parameter | Description
--- | ---
    font
| The new Font for NOTATION Symbol.

## setSymbolForeground()

Sets the NOTATION Symbol foreground color.

#### Syntax

    public void setSymbolForeground( java.awt.Color color);

Parameter | Description
--- | ---
    color
| The new Color for NOTATION Symbol.

## setTagFont()

Sets the Tag font.

#### Syntax

    public void setTagFont( java.awt.Font font);

Parameter | Description
--- | ---
    font
| The new Font for the XML Tags.

## setTagForeground()

Sets the Tag foreground color.

#### Syntax

    public void setTagForeground( java.awt.Color color);

Parameter | Description
--- | ---
    color
| The new Color for the XML Tags.

## setXMLDocument()

Associates the XMLviewer with a XML document.

#### Syntax

    public void setXMLDocument( org.w3c.dom.Document document);

Parameter | Description
--- | ---
    document
| The Document to display.

## XMLSourceViewBeanInfo Class

This class provides information about the XMLSourceView Bean.

#### Syntax

    public class XMLSourceViewBeanInfo extends java.beans.SimpleBeanInfo

##### Table 10-23 Summary of Methods of XMLSourceViewBeanInfo

Method | Description
--- | ---
XMLSourceViewBeanInfo() | Class constructor.
getIcon() | Retrieves an image object representing the requested icon type for XMLSourceView bean in toolbars, toolboxes, and so on.
getPropertyDescriptors() | Retrieves an array of XMLSourveView bean's editable PropertyDescriptors.

## XMLSourceViewBeanInfo()

Class constructor.

#### Syntax

    public  XMLSourceViewBeanInfo();

## getIcon()

Retrieves an image object representing the requested icon type for XMLSourceView bean in toolbars, toolboxes, and so on. Overrides `getIcon()` in `java.beans.SimpleBeanInfo` class.

#### Syntax

    public java.awt.Image getIcon( int iconKind);

Parameter | Description
--- | ---
    iconKind
| The kind of icon requested.

## getPropertyDescriptors()

Retrieves an array of XMLSourveView bean's editable PropertyDescriptors. Overrides `getPropertyDescriptors()` in `java.beans.SimpleBeanInfo` Class.

#### Syntax

    public java.beans.PropertyDescriptor[] getPropertyDescriptors();

## oracle.xml.transviewer Package

This is a visual bean. It allows users to load XML and XSL buffers from the file system or from the database's CLOB tables. The XML buffer can be transformed using the XSL buffer. XML, XSL or HTML buffers can be saved in the file system or in the database as CLOB tables. Each CLOB table has two columns, string type to hold the filename and CLOB type to hold the file data. CLOB tables can be created or deleted. The XML and XSL buffers can be edited and parsed.

The classes of the o`racle.xml.srcviewer` as summarized in Table 10-24.

##### Table 10-24 Summary of Classes of oracle.xml.transviewer

Class | Description
--- | ---
DBAccess Class | Maintains CLOB tables that can hold multiple XML and text documents.
DBAccessBeanInfo Class | This class provides information about the DBAccess Bean.
XMLTransformPanel Class | Applies XSL transformations to XML documents and visualizes the result.
XMLTransformPanelBeanInfo Class | This class provides information about the XMLTransformPanel Bean
XMLTransViewer Class | Simple application that uses XMLTransformPanel. Can be used from the command line to edit and parse XML files, edit and apply XSL transformations and retrieve and save XML, XSL and result files in the file system or in the database.

## DBAccess Class

Maintains CLOB tables that can hold multiple XML and text documents. Each table is created using the 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 and the `FILENAME` field holds a unique string that is used as a key to retrieve, update or delete the row.

- The document text is stored in the `FILEDATA` field that is a CLOB object.

- These CLOB tables are automatically maintained by the transviewer bean.

- The CLOB tables maintained by this class can be used by the transviewer bean.

- The class creates and deletes CLOB tables, lists a CLOB table content, and also adds, replaces or deletes text documents in these CLOB tables.

#### Syntax

    public class DBAccess extends java.lang.Object

##### Table 10-25 Summary of Methods of DBAcceess

Method | Description
--- | ---
DBAccess() | Class constructor.
createBLOBTable() | Create BLOB table, returning TRUE if successful.
createXMLTable() | Creates XML table, returning TRUE if successful.
deleteBLOBName() | Deletes binary file from BLOB table, returning `TRUE` if successful.
deleteXMLName() | Delete file from XML table, returning `TRUE` if successful.
dropBLOBTable() | Deletes BLOB table. `TRUE` if successful.
dropXMLTable() | Deletes XML table. Returns `TRUE` if successful.
getBLOBData() | Retrieves binary file from BLOB table as a byte array. Returns `TRUE` if successful.
getNameSize() | Returns the size of the field where the filename is kept.
getXMLData() | Retrieves text file from XML table as a String.
getXMLNames() | Returns all file names in XML table as a String array.
getXMLTableNames() | Retrieves an array of all XML table names, starting with a user-specified string.
insertBLOBData() | Inserts binary file as a row in BLOB table. Returns `TRUE` if successful.
insertXMLData() | Inserts text file as a row in XML table. Returns `TRUE` if successful.
isXMLTable() | Checks if the table is an XML table, in which case returns `TRUE`.
replaceXMLData() | Replaces text file as a row in XML table, returning `TRUE` if successful.
xmlTableExists() | Checks if the XML table exists, returning `TRUE` if successful.

## DBAccess()

Class constructor.

#### Syntax

    public  DBAccess();

## createBLOBTable()

Create BLOB table, returning `TRUE` if successful.

#### Syntax

    public boolean createBLOBTable( Connection con,
                                      String tableName);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.

## createXMLTable()

Creates XML table, returning `TRUE` if successful.

#### Syntax

    public boolean createXMLTable( Connection con,
                                   String tableName);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.

## deleteBLOBName()

Deletes binary file from BLOB table, returning `TRUE` if successful.

#### Syntax

    public boolean deleteBLOBName( java.sql.Connection con,
                                     String tableName,
                                   String blobName);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.
    blobName
| The file name.

## deleteXMLName()

Delete file from XML table, returning `TRUE` if successful.

#### Syntax

    public boolean deleteXMLName( java.sql.Connection con,
                                  String tableName,
                                  String xmlName);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.
    xmlName
| The file name.

## dropBLOBTable()

Deletes BLOB table. `TRUE` if successful.

#### Syntax

    public boolean dropBLOBTable( java.sql.Connection con,
                                  String tableName);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.

## dropXMLTable()

Deletes XML table. Returns `TRUE` if successful.

#### Syntax

    public boolean dropXMLTable( java.sql.Connection con,

                        java.lang.String tableName);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.

## getBLOBData()

Retrieves binary file from BLOB table as a byte array. Returns `TRUE` if successful.

#### Syntax

    public byte[] getBLOBData( java.sql.Connection con,
                               String tableName,
                               String xmlName);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.
    xmlName
| The file name.

## getNameSize()

Returns the size of the field where the filename is kept.

#### Syntax

    public int getNameSize();

## getXMLData()

Retrieves text file from XML table as a String.

#### Syntax

    public java.lang.String getXMLData( java.sql.Connection con,
                                        String tableName,
                                        String xmlName);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.
    xmlName
| The file name.

## getXMLNames()

Returns all file names in XML table as a String array.

#### Syntax

    public java.lang.String[] getXMLNames( java.sql.Connection con,
                                           String tableName);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.

## getXMLTableNames()

Retrieves an array of all XML table names, starting with a user-specified string.

#### Syntax

    public java.lang.String[] getXMLTableNames( java.sql.Connection con,
                                                String tablePrefix);

Parameter | Description
--- | ---
    con
| The Connection object.
    tablePrefix
| The table prefix string that starts the retrieved array of XML table names.

## insertBLOBData()

Inserts binary file as a row in BLOB table. Returns `TRUE` if successful.

#### Syntax

    public boolean insertBLOBData( java.sql.Connection con,
                                   String tableName,
                                   String xmlName,
                                   byte[] xmlData);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.
    xmlName
| The file name.
    xmlData
| The byte array with file data.

## insertXMLData()

Inserts text file as a row in XML table. Returns `TRUE` if successful.

#### Syntax

    public boolean insertXMLData( java.sql.Connection con,
                                  String tableName,
                                  String xmlName,
                                  String xmlData);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.
    xmlName
| The file name.
    xmlData
| The String with file data.

## isXMLTable()

Checks if the table is an XML table, in which case returns `TRUE`.

#### Syntax

    public boolean isXMLTable( java.sql.Connection con,
                               String tableName);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.

## replaceXMLData()

Replaces text file as a row in XML table, returning `TRUE` if successful.

#### Syntax

    public boolean replaceXMLData( java.sql.Connection con,
                                   String tableName,
                                   String xmlName,
                                   String xmlData);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.
    xmlName
| The file name.
    xmlData
| The String with file data.

## xmlTableExists()

Checks if the XML table exists, returning `TRUE` if successful.

#### Syntax

    public boolean xmlTableExists( java.sql.Connection con,
                                   String tableName);

Parameter | Description
--- | ---
    con
| The Connection object.
    tableName
| The table name.

## DBAccessBeanInfo Class

This class provides information about the DBAccess Bean.

#### Syntax

    public class DBAccessBeanInfo extends java.beans.SimpleBeanInfo

##### Table 10-26 Summary of Methods of DBAccessBeanInfo

Method | Description
--- | ---
DBAccessBeanInfo() | Class constructor.
getIcon() | Retrieves an image object representing the requested icon.
getPropertyDescriptors() | Retrieves an array of editable PropertyDescriptors.

## DBAccessBeanInfo()

Class constructor.

#### Syntax

    public  DBAccessBeanInfo();

## getIcon()

Retrieves an image object representing the requested icon type for DBAcceess bean in toolbars, toolboxes, and so on.

#### Syntax

    public java.awt.Image getIcon(int iconKind);

Parameter | Description
--- | ---
    iconKind
| The kind of icon requested.

## getPropertyDescriptors()

Retrieves an array of DBAccess bean's editable PropertyDescriptors.

#### Syntax

    public java.beans.PropertyDescriptor[] getPropertyDescriptors();

## XMLTransformPanel Class

XMLTransformPanel visual bean. Applies XSL transformations to XML documents and visualizes the result. Allows editing of input XML and XSL documents and files.

#### Syntax

    public class XMLTransformPanel extends javax.swing.JPanel

## XMLTransformPanel()

The class constructor. Creates an object of type `XMLTransformPanel`.

#### Syntax

    public  XMLTransformPanel();

## XMLTransformPanelBeanInfo Class

This class provides information about the XMLTransformPanel Bean.

#### Syntax

    public class XMLTransformPanelBeanInfo extends java.beans.SimpleBeanInfo

##### Table 10-27 Summary of Methods of XMLTransformPanelBeanInfo

Method | Description
--- | ---
XMLTransformPanelBeanInfo() | Class constructor.
getIcon() | Retrieves an image object representing the requested icon type for XMLTransformPanel bean.
getPropertyDescriptors() | Retrieves an array of XMLTransformPanel bean's editable PropertyDescriptors.

## XMLTransformPanelBeanInfo()

Class constructor.

#### Syntax

    public  XMLTransformPanelBeanInfo();

## getIcon()

Retrieves an image object that represents the icon type.

#### Syntax

    public java.awt.Image getIcon( int iconKind);

Parameter | Description
--- | ---
    iconKind
| The kind of icon requested.

## getPropertyDescriptors()

Retrieves an array of XMLTransformPanel bean's editable PropertyDescriptors.

#### Syntax

    public java.beans.PropertyDescriptor[] getPropertyDescriptors();

## XMLTransViewer Class

Simple application that uses XMLTransformPanel. Can be used from the command line to edit and parse XML files, edit and apply XSL transformations and retrieve and save XML, XSL and result files in the file system or in the database.

#### Syntax

    public class XMLTransViewer extends java.lang.Object

##### Table 10-28 Summary of Methods of XMLTransViewer

Method | Description
--- | ---
XMLTransViewer() | Class constructor
getReleaseVersion() | Returns the release version of the Oracle XML Transviewer, as a String.
main() | Starts a new XMLTransViewer.

## XMLTransViewer()

Class constructor

#### Syntax

    public  XMLTransViewer();

## getReleaseVersion()

Returns the release version of the Oracle XML Transviewer, as a String.

#### Syntax

    public static java.lang.String getReleaseVersion();

## main()

The main function which starts a new XMLTransViewer.

#### Syntax

    public static void main( String[] args);

Parameter | Description
--- | ---
    args
| Arguments of an XMLTransViewer instance.

## oracle.xml.treeviewer Package

This is a visual bean. It displays XML documents as a tree, illustrating the DOM tree structure of a XML document. The user can collapse or expand the nodes.

The classes of the o`racle.xml.treeviewer` as summarized in Table 10-29.

##### Table 10-29 Summary of Classes of oracle.xml.transviewer

Class | Description
--- | ---
XMLTreeView Class | Shows an XML document as a tree.
XMLTreeViewBeanInfo Class | This class provides information about the XMLTreeView Bean.

## XMLTreeView Class

Shows an XML document as a tree. Recognizes the following XML DOM nodes: `Tag, Attribute Name, Attribute Value, Comment, CDATA, PCDATA, PI Data, PI Name` and `NOTATION` Symbol. Takes as input an `org.w3c.dom.Document` object.

#### Syntax

    public class XMLTreeView extends javax.swing.JPanel

##### Table 10-30 Fields of XMLTreeView

Field | Syntax | Description
--- | --- | ---
    model
    protected
     oracle.xml.treeviewer.XMLTreeModel model
| Data model for JTree formed from DOM nodes.
    scrollPane
    protected transient
     javax.swing.JScrollPane scrollPane
| Container that displays the Tree. Supports horizontal and vertical scrolling.
    theTree
    protected transient
         javax.swing.JTree theTree
| Java component to render the various nodes of the DOM Tree.

##### Table 10-31 Summary of Methods of XMLTreeView

Method | Description
--- | ---
XMLTreeView() | The class constructor.
getPreferredSize() | Returns the XMLTreeView preferred size.
getTree() | Returns the visual tree as a JTree.
getXMLTreeModel() | Returns the datamodel for JTree as XMLTreeModel.
setXMLDocument() | Associates the XMLTreeViewer with a XML document.
updateUI() | Forces the XMLTreeView to update/refresh UI.

## XMLTreeView()

The class constructor. Creates an object of type `XMLTreeView.`

#### Syntax

    public  XMLTreeView();

## getPreferredSize()

Returns the Dimension object containing the XMLTreeView preferred size. Overrides `getPreferredSize()` in `javax.swing.JComponent` class.

#### Syntax

    public java.awt.Dimension getPreferredSize();

## getTree()

Returns the visual tree as a JTree.

#### Syntax

    protected javax.swing.JTree getTree();

## getXMLTreeModel()

Returns the datamodel for JTree as XMLTreeModel.

#### Syntax

    protected oracle.xml.treeviewer.XMLTreeModel getXMLTreeModel();

## setXMLDocument()

Associates the XMLTreeViewer with a XML document.

#### Syntax

    public void setXMLDocument( org.w3c.dom.Document document);

Parameter | Description
--- | ---
    doc
| The Document to display.

## updateUI()

Forces the XMLTreeView to update/refresh UI.

#### Syntax

    public void updateUI();

## XMLTreeViewBeanInfo Class

This class provides information about the XMLTreeView Bean.

#### Syntax

    public class XMLTreeViewBeanInfo extends java.beans.SimpleBeanInfo

##### Table 10-32 Summary of Methods of XMLTreeViewBeanInfo

Method | Description
--- | ---
XMLTreeViewBeanInfo() | Class constructor.
getIcon() | Retrieves an image object representing the requested icon type for XMLTreeView.
getPropertyDescriptors() | Retrieves an array of XMLTreeViewl bean's editable PropertyDescriptors.

## XMLTreeViewBeanInfo()

Class constructor.

#### Syntax

    public  XMLTreeViewBeanInfo();

## getIcon()

Retrieves an image object representing the requested icon type for XMLTreeView.

#### Syntax

    public java.awt.Image getIcon( int iconKind);

Parameter | Description
--- | ---
    iconKind
| The kind of icon requested.

## getPropertyDescriptors()

Retrieves an array of XMLTreeViewl bean's editable PropertyDescriptors.

#### Syntax

    public java.beans.PropertyDescriptor[] getPropertyDescriptors();

## oracle.xml.differ Package

The `oracle.xml.differ` is a non-visual bean with a visual demo. It enables comparisons of two XML documents and generation of the differences as XSLT code. The XSLT can be applied to the first file to transform it into the second file. The visual demo enables the user to view the differences between the two XML documents graphically.

The classes of the o`racle.xml.differ` as summarized in Table 10-33.

##### Table 10-33 Summary of Classes of oracle.xml.differ

Class | Description
--- | ---
XMLDiff Class | Defines an interface for comparing two XML files.
XMLDiffBeanInfo Class | This class provides information about the XMLDiff Bean.

## XMLDiff Class

Defines an interface for comparing two XML files. It enables two XML files to be compared to check for their equivalence. It provides the objects to display the differences, if any, in a graphical format. The differences can also be represented as XSL. The corresponding XSL stylesheet with the differences can be generated as a file or an XMLDocument object. The first XML file can be transformed into the second XML file by using the XSL stylesheet generated.

#### Syntax

    oracle.xml.differ

##### Table 10-34 Summer of Methods of XMLDiff

Method | Description
--- | ---
XMLDiff() | Class constructor.
setFiles() | Sets the XML files which need to be compared.
setDocuments() | Sets the XML documents which need to be compared.
setInput1() | Sets the first XML file or document which need to be compared.
setInput2() | Sets the second XML file or document which need to be compared.
getDocument1() | Gets the document root as an XMLDocument object of the first XML tree.
getDocument2() | Gets the document root as an XMLDocument object of the second XML tree.
diff() | Finds the differences between the two XML files or the two XMLDocument objects. Retrieves the visual text panel as JTextPane object which visually shows the differences in the first XML file or document.
getDiffPane1() | Retrieves the visual text panel as JTextPane object which visually shows the differences in the first XML file or document.
getDiffPane2() | Retrieves the visual text panel as JTextPane object which visually shows the differences in the second XML file or document.
setIndentIncr() | Sets the indentation for the XSL generation.
setNewNodeIndentIncr() | Generates an XSL file, with user-defined filename, which represents the differences between the two initially set XML files.
generateXSLFile() | Generates an XSL file, with user-defined filename, which represents the differences between the two initially set XML files.
generateXSLDOC() | Generates an XSL stylesheet as an XMLDocument which represents the differences between the two initially set XML documents.
equals() | Compares two nodes. It is called by the differ algorithm. If needed, this function can be overwritten for customized comparisons.
domBuilderErrorCalled() | Method implementing the DOMBuilderErrorListener interface called only by the DOM parser when there is an error while parsing.
domBuilderError() | Method implementing the DOMBuilderErrorListener interface called only by the DOM parser.
domBuilderOver() | Method implementing DOMBuilderListener interface called only by a DOM parser thread when parsing completes.
domBuilderStarted() | Method implementing DOMBuilderListener interface called only by the DOM parser when the parsing starts.
printDiffTree() | Prints the differences tree which contains the node names and values which have been identified as differences by the algorithm. Useful for debugging.
setNoMoves() | Assume that there are no moves to be detected by the diff algorithm. This function should be called before the diff() function. It will result in a performance gain.

## XMLDiff()

Class constructor.

#### Syntax

    public XMLDiff();

## setFiles()

Sets the XML files which need to be compared. Both files are parsed into DOM trees for comparison. This is faster than calling setInput1() and setInput2(). Throws the following exceptions:

- `java.io.IOException` when an I/O error occurs.

- `XMLParseException` when parsing XML document.

- `SAXException` when parsing XML document.

- `java.lang.InterruptedException` if a sleeping thread is interrupted.

#### Syntax

    public void setFiles( java.io.File file1,
                          java.io.File file2);

Parameter | Description
--- | ---
    file1
| First XML file.
    file2
| Second XML file.

## setDocuments()

Sets the XML documents which need to be compared.

#### Syntax

    public void setDocuments( XMLDocument doc1,
                              XMLDocument doc2);

Parameter | Description
--- | ---
    doc1
| First XML document.

## setInput1()

Sets the first XML file or document which need to be compared. The input file is parsed into a DOM tree for comparison. Throws the following exceptions:

- `java.io.IOException` when an I/O error occurs.

- `XMLParseException` when parsing XML document.

- `SAXException` when parsing XML document.

- `java.lang.InterruptedException` if a sleeping thread is interrupted.

The options are described in the following table.

Syntax | Description
--- | ---
    public void setInput1(
         File file1);
| Sets the first XML file which needs to be compared.
    public void setInput1(
         XMLDocument doc1);
| Sets the first XML document which needs to be compared.

Parameter | Description
--- | ---
    file1
| The first XML file.
    doc1
| The first XML document.

## setInput2()

Sets the second XML file or document which need to be compared. The input file is parsed into a DOM tree for comparison. Throws the following exceptions:

- `java.io.IOException` when an I/O error occurs.

- `XMLParseException` when parsing XML document.

- `SAXException` when parsing XML document.

- `java.lang.InterruptedException` if a sleeping thread is interrupted.

The options are described in the following table.

Syntax | Description
--- | ---
    public void setInput2(
         File file2);
| Sets the second XML file which needs to be compared.
    public void setInput2(
         XMLDocument doc2);
| Sets the second XML document which needs to be compared.

Parameter | Description
--- | ---
    file2
| The second XML file.
    doc2
| The second XML document.

## getDocument1()

Gets the document root as an XMLDocument object of the first XML tree.

#### Syntax

    public XMLDocument getDocument1();

## getDocument2()

Gets the document root as an XMLDocument object of the second XML tree.

#### Syntax

    public XMLDocument getDocument2();

## diff()

Finds the differences between the two XML files or the two XMLDocument objects. Returns `FALSE` if the XML files or docs are same, `TRUE` if they are different. Throws `java.lang.NullPointerException` when XML files are not parsed successfully, or if xml documents have not been set.

#### Syntax

    public boolean diff();

## getDiffPane1()

Retrieves the visual text panel as JTextPane object which visually shows the differences in the first XML file or document.

#### Syntax

    public javax.swing.JTextPane getDiffPane1();

## getDiffPane2()

Retrieves the visual text panel as JTextPane object which visually shows the differences in the second XML file or document.

#### Syntax

    public javax.swing.JTextPane getDiffPane2();

## setIndentIncr()

Sets the indentation for the XSL generation. This should be called before the `generateXSLFile()` or ge`nerateXSLDoc()`. The indentation will be applied to all attributes only. For indenting newly inserted nodes, see `setNewNodeIndentIncr()`.

#### Syntax

    public void setIndentIncr( int spaces);

Parameter | Description
--- | ---
    spaces
| Indentation increment in number of spaces for attributes.

## setNewNodeIndentIncr()

Sets the indentation for the XSL generation. This should be called before the generateXSLFile() or generateXSLDoc(). The indentation will be applied to all newly inserted nodes only. For attributes indentation support, see `setIndentIncr()`.

#### Syntax

    public void setNewNodeIndentIncr( int spaces);

Parameter | Description
--- | ---
    spaces
| Indentation increment in number of spaces for new nodes.

## generateXSLFile()

Generates an XSL file, with user-defined filename, which represents the differences between the two initially set XML files. If the input filename is `NULL,` a default XSL file named `XMLDiff.xsl` will be generated. The first XML file can be transformed into the second XML file using the XSL stylesheet generated. If the XML are the same, the XSL generated will transform the first XML file into the second XML file, making the two files equivalent. Throws `java.io.IOException` if the XSL file is not created successfully.

#### Syntax

    public void generateXSLFile( String fileName);

Parameter | Description
--- | ---
fileName | Output XSL file name.

## generateXSLDOC()

Generates an XSL stylesheet as an XMLDocument which represents the differences between the two initially set XML documents. If the input filename is `NULL,` a default XSL file named `XMLDiff.xsl` will be generated. The first XML file can be transformed into the second XML file using the XSL stylesheet generated. If the XML are the same, the XSL generated will transform the first XML file into the second XML file, making the two files equivalent. Throws the following exceptions:

- `java.io.IOException` when an I/O error occurs.

- `java.io.FileNotFoundException` when the XSL file generated not found.

- `SAXException` when parsing XML document.

- `java.lang.InterruptedException` if a sleeping thread is interrupted.

#### Syntax

    public void generateXSLDoc();

## equals()

Compares two nodes. It is called by the differ algorithm. If needed, this function can be overwritten for customized comparisons.

#### Syntax

    protected boolean equals( Node node1,
                              Node node2);

Parameter | Description
--- | ---
    node1
| The first node to compare.
    node2
| The second node to compare.

## domBuilderErrorCalled()

Method implementing the DOMBuilderErrorListener interface called only by the DOM parser when there is an error while parsing. Specified by domBuilderErrorCalled in DOMBuilderErrorListener Interface.

#### Syntax

    public void domBuilderErrorCalled( DOMBuilderErrorEvent p0);

Parameter | Description
--- | ---
    p0
| Error object thrown by the parser.

## domBuilderError()

Method implementing the DOMBuilderErrorListener interface called only by the DOM parser. Specified by domBuilderError in DOMBuilderListener interface.

#### Syntax

    public void domBuilderError( DOMBuilderEvent p0);

Parameter | Description
--- | ---
    p0
| Parser event errors handled by domBuilderErrorCalled().

## domBuilderOver()

Method implementing DOMBuilderListener interface called only by a DOM parser thread when parsing completes. Specified by domBuilderOver in DOMBuilderListener interface

#### Syntax

    public void domBuilderOver ( DOMBuilderEvent p0);

Parameter | Description
--- | ---
    p0
| Parser event.

## domBuilderStarted()

Method implementing DOMBuilderListener interface called only by the DOM parser when the parsing starts. Specified by domBuilderStarted in DOMBuilderListener interface.

#### Syntax

    public void domBuilderStarted( DOMBuilderEvent p0);

Parameter | Description
--- | ---
    p0
| Parser event.

## printDiffTree()

Prints the diff tree which contains the node names and values which have been identified as different by the algorithm. Useful for debugging. Throws `java.io.IOException` if the XSL file is not created successfully.

#### Syntax

    public void printDiffTree( int tree,
                               BufferedWriter out);

Parameter | Description
--- | ---
    tree
| The tree to print, 1 or 2.
    out
| The BufferredWriter containing the printed diff tree.

## setNoMoves()

Assume that there are no moves to be detected by the diff algorithm. This function should be called before the diff() function. It will result in a performance gain.

#### Syntax

    public void setNoMoves();

## XMLDiffBeanInfo Class

This class provides information about the XMLDiff Bean.

#### Syntax

    public class XMLDiffBeanInfo extends java.beans.SimpleBeanInfo

##### Table 10-35 Summary of Methods of XMLDiffBeanInfo

Method | Description
--- | ---
XMLDiffBeanInfo() | Class constructor.
getPropertyDescriptors() | Retrieves an image object representing the requested icon type for XMLDiff bean in toolbars, toolboxes, and so on.
getIcon() | Retrieves an array of XMLDiff bean's editable PropertyDescriptors

## XMLDiffBeanInfo()

Class constructor.

#### Syntax

    public XMLDiffBeanInfo();

## getPropertyDescriptors()

Retrieves an array of XMLDiff bean's editable PropertyDescriptors. Overrides `getPropertyDescriptors()` in `java.beans.SimpleBeanInfo` Class.

#### Syntax

    public java.beans.PropertyDescriptor[] getPropertyDescriptors();

## getIcon()

Retrieves an image object representing the requested icon type for XMLDiff bean in toolbars, toolboxes, and so on. Overrides `getIcon()` in `java.beans.SimpleBeanInfo` class.

#### Syntax

    public java.awt.Image getIcon( int iconKind);

Parameter | Description
--- | ---
    iconKind
| The kind of icon requested.

| Copyright © 2001, 2003 Oracle Corporation. All Rights Reserved. |
Home | Contents | Index