public final class DelugeTransformer
extends java.lang.Object
It can also handle regular transformations (via transform()).
Special thanks to Michael Kay for the original example of this code.
Constructor and Description |
---|
DelugeTransformer() |
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.
|
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
Supports XSLTs with xsl:stream element.
Convenience method.
xml
- The XML to transformxsl
- The XSLT that does the transformationoutput
- The output of the transformationjava.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 foundpublic 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
Supports XSLTs with xsl:stream element.
Convenience method.
xml
- The XML to transformxsl
- The XSLT that does the transformationoutput
- The output of the transformationjava.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 foundpublic 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
This is where the real work is done.
xml
- The XML to transformxsl
- The XSLT that does the transformationoutput
- The output of the transformationjavax.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.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
A convenience method.
xml
- The XML to transformxsl
- The XSLT that does the transformationoutput
- The output of the transformationjavax.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.