public class StylesheetCache extends Object
Modifier and Type | Method and Description |
---|---|
static void |
clearCache()
Clear XLS Stylesheets cache
|
static Transformer |
newTransformer(String sFilePath)
Get Transformer object for XSL file.
|
static void |
setParameters(Transformer oXSL,
Properties oProps)
Set parameters for a StyleSheet taken from a properties collection.
|
static String |
transform(InputStream oStyleSheetStream,
InputStream oXMLInputStream,
String sEncoding,
Properties oProps)
Perform XSLT transformation
|
static String |
transform(InputStream oStyleSheetStream,
String sXMLInput,
Properties oProps)
Perform XSLT transformation
|
static void |
transform(String sStyleSheetPath,
InputStream oXMLInputStream,
OutputStream oOutputStream,
Properties oProps)
Perform XSLT transformation
|
static String |
transform(String sStyleSheetPath,
String sXMLInput,
Properties oProps)
Perform XSLT transformation
|
String |
validate(InputStream oXsd,
InputStream oXml)
Validate an XML document using an XSD schema
|
public static Transformer newTransformer(String sFilePath) throws FileNotFoundException, IOException, TransformerException, TransformerConfigurationException
sFilePath
- File PathIOException
TransformerException
TransformerConfigurationException
FileNotFoundException
public static void setParameters(Transformer oXSL, Properties oProps) throws NullPointerException
oXSL
- Transformer object.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 XSL
as <xsl:param name="param_workarea"/>NullPointerException
- if oXSL is null or oProps is nullpublic static void transform(String sStyleSheetPath, InputStream oXMLInputStream, OutputStream oOutputStream, Properties oProps) throws IOException, FileNotFoundException, NullPointerException, TransformerException, TransformerConfigurationException
sStyleSheetPath
- File Path to XSL style sheet fileoXMLInputStream
- Input Stream for XML source dataoOutputStream
- Stream where output is to be writtenoProps
- Parameters for Transformer. The substring "param_"
will be added as a prefix to each property name passed as parameter.
So if you pass a property named "workarea" it must be retrieved from XSL
as <xsl:param name="param_workarea"/>NullPointerException
- if oProps is nullFileNotFoundException
- if sStyleSheetPath does not existIOException
TransformerException
TransformerConfigurationException
public static String transform(String sStyleSheetPath, String sXMLInput, Properties oProps) throws IOException, FileNotFoundException, UnsupportedEncodingException, NullPointerException, TransformerException, TransformerConfigurationException
sStyleSheetPath
- File Path to XSL style sheet filesXMLInput
- Input String with XML source dataoProps
- Parameters for Transformer. 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 XSL
as <xsl:param name="param_workarea"/>NullPointerException
- if sXMLInput or oProps are nullFileNotFoundException
- if sStyleSheetPath does not existIOException
UnsupportedEncodingException
TransformerException
TransformerConfigurationException
public static String transform(InputStream oStyleSheetStream, InputStream oXMLInputStream, String sEncoding, Properties oProps) throws IOException, FileNotFoundException, UnsupportedEncodingException, NullPointerException, TransformerException, TransformerConfigurationException
oStyleSheetStream
- Stream to XSL style sheetoXMLInputStream
- Input Stream with XML source datasEncoding
- Input Stream data encodingoProps
- Parameters for Transformer. 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 XSL
as <xsl:param name="param_workarea"/>NullPointerException
- if sXMLInput or oProps are nullFileNotFoundException
- if sStyleSheetPath does not existIOException
UnsupportedEncodingException
TransformerException
TransformerConfigurationException
public static String transform(InputStream oStyleSheetStream, String sXMLInput, Properties oProps) throws IOException, FileNotFoundException, UnsupportedEncodingException, NullPointerException, TransformerException, TransformerConfigurationException
oStyleSheetStream
- Stream to XSL style sheetsXMLInput
- Input String with XML source dataoProps
- Parameters for Transformer. 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 XSL
as <xsl:param name="param_workarea"/>NullPointerException
- if sXMLInput or oProps are nullFileNotFoundException
- if sStyleSheetPath does not existIOException
UnsupportedEncodingException
TransformerException
TransformerConfigurationException
public String validate(InputStream oXsd, InputStream oXml)
oXsd
- InputStream to XSD schemaoXml
- InputStream to XML documentpublic static void clearCache()
Copyright © 2019. All rights reserved.