oracle.xml.async

## Class XSLTransformer

- java.lang.Object
- - oracle.xml.async.XSLTransformer

All Implemented Interfaces:
  java.io.Serializable, java.lang.Runnable

    public class XSLTransformer
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Runnable

Applies XSL transformation in a background thread.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`XSLTransformer()` XSLTransformer constructor
`XSLTransformer(int id)` XSLTransformer constructor accepting an identifier

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addXSLTransformerErrorListener(XSLTransformerErrorListener p0)` Adds an XSLTransformer error event listener
`void` `addXSLTransformerListener(XSLTransformerListener p0)` Adds a XSLTransformer listener
`int` `getId()` Returns the unique XSLTransformer id
`DocumentFragment` `getResult()` Returns the document fragment for the resulting document.
`void` `processXSL(XSLStylesheet xsl, java.io.InputStream xml, java.net.URL ref)` Initiates XSL Transformation in the background.
`void` `processXSL(XSLStylesheet xsl, java.io.Reader xml, java.net.URL ref)` Initiates XSL Transformation in the background.
`void` `processXSL(XSLStylesheet xsl, java.net.URL xml, java.net.URL ref)` Initiates XSL Transformation in the background.
`void` `processXSL(XSLStylesheet xsl, XMLDocument xml)` Initiates XSL Transformation in the background.
`void` `processXSL(XSLStylesheet xsl, XMLDocument xml, java.io.OutputStream os)` Initiates XSL Transformation in the background.
`void` `removeDOMTransformerErrorListener(XSLTransformerErrorListener p0)` Removes an XSLTransformer error event listener
`void` `removeXSLTransformerListener(XSLTransformerListener p0)` Removes a XSLTransformer listener
`void` `run()` Starts a separate thread to do the XSL Transformation.
`void` `setErrorStream(java.io.OutputStream out)` Sets the error stream used by the XSL processor
`void` `setXSLTVersion(XSLProcessor.XSLTVersion ver)` Sets the XSLT Version flag used by the XSL processor
`void` `showWarnings(boolean yes)` Sets the showWarnings flag used by the XSL processor

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### XSLTransformer

    public XSLTransformer()

XSLTransformer constructor

#### XSLTransformer

    public XSLTransformer(int id)

XSLTransformer constructor accepting an identifier

Parameters:
  `id` - - A unique integer that can be used to identify the XSLTransformer instance during event processing

### Method Detail

#### getId

    public int getId()

Returns the unique XSLTransformer id

Returns:
  The id of this XSLTransformer.

#### run

    public void run()

Starts a separate thread to do the XSL Transformation.

Specified by:
  `run` in interface `java.lang.Runnable`

#### addXSLTransformerListener

    public void addXSLTransformerListener(XSLTransformerListener p0)

Adds a XSLTransformer listener

Parameters:
  `p0` - XSLTransformerListener to be added

#### addXSLTransformerErrorListener

    public void addXSLTransformerErrorListener(XSLTransformerErrorListener p0)

Adds an XSLTransformer error event listener

Parameters:
  `p0` - XSLTransformerErrorListener to be added

#### removeXSLTransformerListener

    public void removeXSLTransformerListener(XSLTransformerListener p0)

Removes a XSLTransformer listener

Parameters:
  `p0` - XSLTransformerListener to be removed

#### removeDOMTransformerErrorListener

    public void removeDOMTransformerErrorListener(XSLTransformerErrorListener p0)

Removes an XSLTransformer error event listener

Parameters:
  `p0` - XSLTransformerErrorListener to be removed

#### processXSL

    public void processXSL(XSLStylesheet xsl,
                           XMLDocument xml)
                    throws XSLException

Initiates XSL Transformation in the background. The control is returned immediately.

Parameters:
  `xsl` - The stylesheet to be used for XSL transformation
  `xml` - The XML document to be used (as a DOM Tree)
Throws:
  `XSLException` - if an error occurs during XSL transformation

#### processXSL

    public void processXSL(XSLStylesheet xsl,
                           java.io.InputStream xml,
                           java.net.URL ref)
                    throws XSLException

Initiates XSL Transformation in the background. The control is returned immediately.

Parameters:
  `xsl` - The stylesheet to be used for XSL transformation
  `xml` - The XML document to be used (as a java.io.InputStream)
  `ref` - Reference URL to resolve external entities in input XML
Throws:
  `XSLException` - if an error occurs during XSL transformation

#### processXSL

    public void processXSL(XSLStylesheet xsl,
                           java.io.Reader xml,
                           java.net.URL ref)
                    throws XSLException

Initiates XSL Transformation in the background. The control is returned immediately.

Parameters:
  `xsl` - The stylesheet to be used for XSL transformation
  `xml` - The XML document to be used (as a java.io.Reader)
  `ref` - Reference URL to resolve external entities in input XML
Throws:
  `XSLException` - if an error occurs during XSL transformation

#### processXSL

    public void processXSL(XSLStylesheet xsl,
                           java.net.URL xml,
                           java.net.URL ref)
                    throws XSLException

Initiates XSL Transformation in the background. The control is returned immediately.

Parameters:
  `xsl` - The stylesheet to be used for XSL transformation
  `xml` - The XML document to be used (as a java.net.URL)
  `ref` - Reference URL to resolve external entities in input XML
Throws:
  `XSLException` - if an error occurs during XSL transformation

#### processXSL

    public void processXSL(XSLStylesheet xsl,
                           XMLDocument xml,
                           java.io.OutputStream os)
                    throws XSLException

Initiates XSL Transformation in the background. The control is returned immediately.

Parameters:
  `xsl` - The stylesheet to be used for XSL transformation
  `xml` - The XML document to be used (as a DOM Tree)
  `os` - Outputstream to which the XSL transformation result is written
Throws:
  `XSLException` - if an error occurs during XSL transformation

#### setErrorStream

    public final void setErrorStream(java.io.OutputStream out)
                              throws java.io.IOException

Sets the error stream used by the XSL processor

Parameters:
  `out` - The error output stream for the XSL processor
Throws:
  `java.io.IOException`

#### showWarnings

    public final void showWarnings(boolean yes)

Sets the showWarnings flag used by the XSL processor

Parameters:
  `yes` - Boolean indicating if XSL processor warnings to be shown or not.

#### setXSLTVersion

    public final void setXSLTVersion(XSLProcessor.XSLTVersion ver)

Sets the XSLT Version flag used by the XSL processor

Parameters:
  `version` - XSLTVersion.XSLT10 or XSLTVersion.XSLT20

#### getResult

    public DocumentFragment getResult()

Returns the document fragment for the resulting document. Call this method 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 avialable.

Returns:
  The resulting document fragment of the XSL transformation.

Copyright © 2003, 2017, Oracle and/or its affiliates. All rights reserved.