org.mitre.deluge

## Class DelugeTransformer

- java.lang.Object
- - org.mitre.deluge.DelugeTransformer

-     public final class DelugeTransformer
      extends java.lang.Object

  An XML/XSLT transformer that can handle streaming XSLT by sending the results to a SAXResult (via transformStreaming())

  It can also handle regular transformations (via transform()).

  Special thanks to Michael Kay for the original example of this code.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DelugeTransformer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `transform(java.io.File xml, java.io.File xsl, java.io.File output)` Transforms an XML with an XSL and write the result to the output.
    `void` | `transform(java.io.File xml, java.io.File xsl, java.lang.String output)` Transforms an XML with an XSL and write the result to the output.
    `void` | `transformStreaming(java.io.File xml, java.io.File xsl, java.io.File output)` Transforms the XML with the XSLT and sends the results to the output.
    `void` | `transformStreaming(java.io.File xml, java.io.File xsl, java.lang.String output)` Transforms the XML with the XSLT and sends the results to the output.

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

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

- - ### Constructor Detail

    - #### DelugeTransformer

          public DelugeTransformer()

  - ### Method Detail

    - #### transformStreaming

          public final void transformStreaming(java.io.File xml,
                                java.io.File xsl,
                                java.io.File output)
                                        throws java.io.FileNotFoundException,
                                               javax.xml.transform.TransformerException,
                                               java.io.IOException

      Transforms the XML with the XSLT and sends the results to the output.

      Supports XSLTs with xsl:stream element.

      Convenience method.

      Parameters:
        `xml` - The XML to transform
        `xsl` - The XSLT that does the transformation
        `output` - The output of the transformation
      Throws:
        `java.io.FileNotFoundException` - Thrown if one of the files cannot be found.
        `javax.xml.transform.TransformerException` - Thrown if the transformation fails.
        `java.io.IOException` - Thrown if the identity.xsl cannot be found

    - #### transformStreaming

          public final void transformStreaming(java.io.File xml,
                                java.io.File xsl,
                                java.lang.String output)
                                        throws java.io.FileNotFoundException,
                                               javax.xml.transform.TransformerException,
                                               java.io.IOException

      Transforms the XML with the XSLT and sends the results to the output.

      Supports XSLTs with xsl:stream element.

      Convenience method.

      Parameters:
        `xml` - The XML to transform
        `xsl` - The XSLT that does the transformation
        `output` - The output of the transformation
      Throws:
        `java.io.FileNotFoundException` - Thrown if one of the files cannot be found.
        `javax.xml.transform.TransformerException` - Thrown if the transformation fails.
        `java.io.IOException` - Thrown if the identity.xsl cannot be found

    - #### transform

          public final void transform(java.io.File xml,
                       java.io.File xsl,
                       java.io.File output)
                               throws javax.xml.transform.TransformerConfigurationException,
                                      java.io.FileNotFoundException,
                                      javax.xml.transform.TransformerException,
                                      java.io.IOException

      Transforms an XML with an XSL and write the result to the output.

      This is where the real work is done.

      Parameters:
        `xml` - The XML to transform
        `xsl` - The XSLT that does the transformation
        `output` - The output of the transformation
      Throws:
        `javax.xml.transform.TransformerConfigurationException` - Thrown if the transformer cannot be configured correctly.
        `java.io.FileNotFoundException` - Thrown if one of the files cannot be found.
        `javax.xml.transform.TransformerException` - Thrown if the transformation fails.
        `java.io.IOException` - Thrown if one of the files cannot be found.

    - #### transform

          public final void transform(java.io.File xml,
                       java.io.File xsl,
                       java.lang.String output)
                               throws javax.xml.transform.TransformerException,
                                      javax.xml.transform.TransformerConfigurationException,
                                      java.io.IOException

      Transforms an XML with an XSL and write the result to the output.

      A convenience method.

      Parameters:
        `xml` - The XML to transform
        `xsl` - The XSLT that does the transformation
        `output` - The output of the transformation
      Throws:
        `javax.xml.transform.TransformerException` - Thrown if the transformation fails.
        `javax.xml.transform.TransformerConfigurationException` - Thrown if the transformer cannot be configured correctly.
        `java.io.IOException` - Thrown if one of the files cannot be found.