org.odftoolkit.odfxsltrunner
Class ODFXSLTRunner

java.lang.Object
  extended by org.odftoolkit.odfxsltrunner.ODFXSLTRunner

public class ODFXSLTRunner
extends Object

Class for applying style sheets to ODF documents.


Field Summary
static int INPUT_MODE_FILE
          Input file is a plain XML file.
static int INPUT_MODE_PACKAGE
          Input file is an ODF package.
static int OUTPUT_MODE_COPY_INPUT_PACKAGE
          The input package is copied and the result of the transformation is stored in the specified path within the copied package.
static int OUTPUT_MODE_FILE
          Output file is a plain XML or text file.
static int OUTPUT_MODE_REPLACE_INPUT_PACKAGE
          The transformation replaces the specified path within the input file.
static int OUTPUT_MODE_STDOUT
          Output is stdout.
static int OUTPUT_MODE_TEMPLATE_PACKAGE
          The result of the transformation is stored in the specified path within the output package.
 
Constructor Summary
ODFXSLTRunner()
          Create new instance of ODFXSLTRunner.
 
Method Summary
 boolean runXSLT(File aStyleSheetFile, List<XSLTParameter> aParams, File aInputFile, int aInputMode, File aOutputFile, int aOutputMode, String aPathInPackage, String aTransformerFactoryClassName, List<String> aExtractFileNames, Logger aLogger)
          Apply a style sheeet.
 boolean runXSLT(String aStyleSheet, List<XSLTParameter> aParams, String aInputFile, int aInputMode, String aOutputFile, int aOutputMode, String aPathInPackage, String aTransformerFactoryClassName, List<String> aExtractFileNames, Logger aLogger)
          Apply a style sheeet.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INPUT_MODE_FILE

public static final int INPUT_MODE_FILE
Input file is a plain XML file.

See Also:
Constant Field Values

INPUT_MODE_PACKAGE

public static final int INPUT_MODE_PACKAGE
Input file is an ODF package. The style sheet is applied to the specified sub file.

See Also:
Constant Field Values

OUTPUT_MODE_FILE

public static final int OUTPUT_MODE_FILE
Output file is a plain XML or text file.

See Also:
Constant Field Values

OUTPUT_MODE_STDOUT

public static final int OUTPUT_MODE_STDOUT
Output is stdout.

See Also:
Constant Field Values

OUTPUT_MODE_REPLACE_INPUT_PACKAGE

public static final int OUTPUT_MODE_REPLACE_INPUT_PACKAGE
The transformation replaces the specified path within the input file.

See Also:
Constant Field Values

OUTPUT_MODE_COPY_INPUT_PACKAGE

public static final int OUTPUT_MODE_COPY_INPUT_PACKAGE
The input package is copied and the result of the transformation is stored in the specified path within the copied package.

See Also:
Constant Field Values

OUTPUT_MODE_TEMPLATE_PACKAGE

public static final int OUTPUT_MODE_TEMPLATE_PACKAGE
The result of the transformation is stored in the specified path within the output package.

See Also:
Constant Field Values
Constructor Detail

ODFXSLTRunner

public ODFXSLTRunner()
Create new instance of ODFXSLTRunner.

Method Detail

runXSLT

public boolean runXSLT(String aStyleSheet,
                       List<XSLTParameter> aParams,
                       String aInputFile,
                       int aInputMode,
                       String aOutputFile,
                       int aOutputMode,
                       String aPathInPackage,
                       String aTransformerFactoryClassName,
                       List<String> aExtractFileNames,
                       Logger aLogger)
Apply a style sheeet.

Parameters:
aStyleSheet - Path of the style sheet
aParams - Parameters that are passed to the XSLT processor
aInputFile - Path of the input file
aInputMode - Input mode
aOutputFile - Path of the output file
aOutputMode - Output mode
aTransformerFactoryClassName - XSLT transformer factory to use
aExtractFileNames - A list of files or directory that shell be extracted from the package
aPathInPackage - Path within the package. Default is "content.xml"
aLogger - Logger object
Returns:
true if an error occured.

runXSLT

public boolean runXSLT(File aStyleSheetFile,
                       List<XSLTParameter> aParams,
                       File aInputFile,
                       int aInputMode,
                       File aOutputFile,
                       int aOutputMode,
                       String aPathInPackage,
                       String aTransformerFactoryClassName,
                       List<String> aExtractFileNames,
                       Logger aLogger)
Apply a style sheeet.

Parameters:
aStyleSheetFile - Style sheet
aParams - Parameters that are passed to the XSLT processor
aInputFile - Input file
aInputMode - Input mode
aOutputFile - Output file
aOutputMode - Output mode
aPathInPackage - Path within the package. Default is "content.xml"
aTransformerFactoryClassName - XSLT transformer factory to use
aExtractFileNames - A list of files or directory that shell be extracted from the package
aLogger - Logger object
Returns:
true if an error occured.


Copyright © 2017 The Apache Software Foundation. All rights reserved.