Class XSLTUtil

java.lang.Object
org.cdlib.mrt.utility.XSLTUtil

public class XSLTUtil extends Object
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 Details

    • XSLTUtil

      public XSLTUtil()
  • Method Details

    • charToEntity

      public static String charToEntity(String text)
      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 formated
      parmTable - 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 formatted
      xslIS - XSL input stream
      parmTable - table of parms to be applied to style sheet
      logger - 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 formated
      parmTable - table of parms to be applied to style sheet
      Returns:
      Transformmed METS for zip formatted response
      Throws:
      TException
    • setParms

      public static void setParms(Transformer transform, Hashtable table)
      set transform parameters based on url query
      Parameters:
      transform - xalan transformer
      table - key-value table