| java.lang.Object com.knowgate.dataxslt.StylesheetCache
StylesheetCache | public class StylesheetCache (Code) | | XSL File Cache
This class keeps a master copy in memory of each XSL Stylesheet file.
When a Transformer object is requested a copy of the master Stylesheet is
done. This is faster than re-loading de XSL file from disk.
StylesheetCache is a WeakHashMap so cached stylesheets can be automatically
garbage collected is memory runs low.
author: Sergio Montoro Ten version: 1.0 |
Inner Class :static class SheetEntry | |
Method Summary | |
public static synchronized Transformer | newTransformer(String sFilePath) Get Transformer object for XSL file.
StylesheetCache automatically checks file last modification date and compares
it with loading date for cached objects. | public static void | setParameters(Transformer oXSL, Properties oProps) Set parameters for a StyleSheet taken from a properties collection.
This method is primarily designed for setting environment parameters.
Parameters: oXSL - Transformer object. Parameters: oProps - Properties to be set as parameters. | public static void | transform(String sStyleSheetPath, InputStream oXMLInputStream, OutputStream oOutputStream, Properties oProps) Perform XSLT transformation
Parameters: sStyleSheetPath - File Path to XSL style sheet file Parameters: oXMLInputStream - Input Stream for XML source data Parameters: oOutputStream - Stream where output is to be written Parameters: oProps - Parameters for Transformer. | public static String | transform(String sStyleSheetPath, String sXMLInput, Properties oProps) Perform XSLT transformation
Parameters: sStyleSheetPath - File Path to XSL style sheet file Parameters: sXMLInput - Input String with XML source data Parameters: oProps - Parameters for Transformer. |
setParameters | public static void setParameters(Transformer oXSL, Properties oProps) throws NullPointerException(Code) | | Set parameters for a StyleSheet taken from a properties collection.
This method is primarily designed for setting environment parameters.
Parameters: oXSL - Transformer object. Parameters: oProps - Properties to be set as parameters. The substring "param_"will be added as a preffix to each property name passed as parameter.So if you pass a property named "workarea" it must be retrieved from XSLas <xsl:param name="param_workarea"/> throws: NullPointerException - if oXSL is null or oProps is null |
|
|