Package org.cdlib.mrt.utility
Class XSLTUtil
java.lang.Object
org.cdlib.mrt.utility.XSLTUtil
This class is a collection of XML Utility functions.
They are all static and so can be called without instanciating this class.
- Author:
- David Loy
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
charToEntity
(String text) Converts a standard text string so it can be included as XML textstatic void
setParms
(Transformer transform, Hashtable table) set transform parameters based on url querystatic String
xslConvert
(InputStream xmlIS, InputStream xslIS, Hashtable parmTable, LoggerInf logger) Convert xml using an xslt stylesheetstatic String
xslConvert
(InputStream xmlIS, String idXSL, Hashtable parmTable, LoggerInf logger) Convert xml using an xslt stylesheetstatic String
xslConvert
(String xml, String idXSL, Hashtable parmTable, LoggerInf logger) static String
xslConvert
(StreamSource sourceXML, StreamSource sourceXSL, Hashtable parmTable, LoggerInf logger) Convert xml using an xslt stylesheet
-
Constructor Details
-
XSLTUtil
public XSLTUtil()
-
-
Method Details
-
charToEntity
Converts a standard text string so it can be included as XML text- Parameters:
text
- String to be converted for inclusion within XML- Returns:
- XML predefined entity encoded string
-
xslConvert
public static String xslConvert(String xml, String idXSL, Hashtable parmTable, LoggerInf logger) throws TException - Throws:
TException
-
xslConvert
public static String xslConvert(InputStream xmlIS, String idXSL, Hashtable parmTable, LoggerInf logger) throws TException Convert xml using an xslt stylesheet- Parameters:
dip
- the DI Package to be formatedparmTable
- table of parms to be applied to style sheet- Returns:
- Transformmed METS for zip formatted response
- Throws:
TException
-
xslConvert
public static String xslConvert(InputStream xmlIS, InputStream xslIS, Hashtable parmTable, LoggerInf logger) throws TException Convert xml using an xslt stylesheet- Parameters:
xmlIS
- XML input stream to be formattedxslIS
- XSL input streamparmTable
- table of parms to be applied to style sheetlogger
- LoggerInf for messages- Returns:
- Transformmed XML in string format
- Throws:
TException
-
xslConvert
public static String xslConvert(StreamSource sourceXML, StreamSource sourceXSL, Hashtable parmTable, LoggerInf logger) throws TException Convert xml using an xslt stylesheet- Parameters:
dip
- the DI Package to be formatedparmTable
- table of parms to be applied to style sheet- Returns:
- Transformmed METS for zip formatted response
- Throws:
TException
-
setParms
set transform parameters based on url query- Parameters:
transform
- xalan transformertable
- key-value table
-