com.adobe.idml
Class FileTransformer

java.lang.Object
  extended by com.adobe.idml.FileTransformer

public class FileTransformer
extends java.lang.Object

The FileTransformer class is used to transform s single XML input file into one or many files. Two use cases for file transformation are supported. The output file can be specified, or the style sheets can be responsible for file output. See the transformFile() method.


Constructor Summary
FileTransformer(java.io.File xslFile, java.util.ArrayList<XslParam> params)
          Construct a FileTransformer loaded with a style sheet.
 
Method Summary
 void addParameters(java.util.ArrayList<XslParam> params)
          Adds parameters that will be passed to the style sheet.
 void clearParameters()
          Clears the parameters that are passed to the style sheet.
 void reset(java.io.File xslFile, java.util.ArrayList<XslParam> params)
          Reinitializes to a new XSL file and set of parameters.
 void transformFile(java.io.File xmlFile, java.io.File outFile)
          Transforms an XML file with the current style sheet and parameters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTransformer

public FileTransformer(java.io.File xslFile,
                       java.util.ArrayList<XslParam> params)
                throws javax.xml.transform.TransformerConfigurationException,
                       javax.xml.transform.TransformerFactoryConfigurationError
Construct a FileTransformer loaded with a style sheet.

Parameters:
xslFile - The XSL file that will be used for transformation.
params - The parameters that will be passed to the style sheet.
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerFactoryConfigurationError
Method Detail

addParameters

public void addParameters(java.util.ArrayList<XslParam> params)
Adds parameters that will be passed to the style sheet.

Parameters:
params -

clearParameters

public void clearParameters()
Clears the parameters that are passed to the style sheet.


reset

public void reset(java.io.File xslFile,
                  java.util.ArrayList<XslParam> params)
           throws javax.xml.transform.TransformerConfigurationException,
                  javax.xml.transform.TransformerFactoryConfigurationError
Reinitializes to a new XSL file and set of parameters.

Parameters:
xslFile -
params - Style sheet parameters, or null.
Throws:
javax.xml.transform.TransformerConfigurationException
javax.xml.transform.TransformerFactoryConfigurationError

transformFile

public void transformFile(java.io.File xmlFile,
                          java.io.File outFile)
                   throws javax.xml.transform.TransformerException,
                          java.io.IOException
Transforms an XML file with the current style sheet and parameters.

Parameters:
xmlFile - The File to transform
outFile - The output file. Transformation has a standard output. This output is captured in the specified outFile if non-null. Often style sheets will manage their own output files. If this is the case the main output isn't needed. A null outFile can be passed if the caller doesn't need the standard output.
Throws:
javax.xml.transform.TransformerException
java.io.IOException


Copyright © 2008 Adobe Systems Incorporated. All Rights Reserved.