Class XSLTSupport


  • public abstract class XSLTSupport
    extends java.lang.Object
    This class provides parser-independent, JAXP-based, support for XSLT-based operations.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Constructor Summary

      Constructors 
      Constructor Description
      XSLTSupport()  
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean getXSLCaching()
      Returns the current status of XSL caching on this class.
      static XSLTSupport newInstance()
      Returns an instance of an XSLTSupport object.
      abstract void setXSLCaching​(boolean cachingIsOn)
      Sets the status of XSL caching on this class, if the underlying XSL processor implements such functionality.
      abstract void transformToFile​(java.io.File xmlFile, java.lang.String xslFile, java.lang.String outputFile)
      Transforms the given XML file using the given XSL file and writes the result into the specified output file
      abstract org.w3c.dom.Node transformToNode​(java.lang.String xmlString, java.io.InputStream stream)
      Transforms the given XML String by the given XSLT InputStream, and returns the result from the XSL transformation as a DOM Node.
      abstract org.w3c.dom.Node transformToNode​(java.lang.String xmlString, java.lang.String xslFile)
      Transforms the given XML String by the given XSLT file, and returns the result from the XSL transformation as a DOM Node.
      abstract org.w3c.dom.Node transformToNode​(org.w3c.dom.Node xmlDoc, java.io.InputStream stream)
      Transforms the given XML DOM Node by the given XSLT file, and returns the result from the XSL transformation as a DOM Node.
      abstract org.w3c.dom.Node transformToNode​(org.w3c.dom.Node xmlDoc, java.lang.String xslFile)
      Transforms the given XML DOM Node by the given XSLT file, and returns the result from the XSL transformation as a DOM Node.
      abstract java.lang.String transformToString​(java.io.File xmlFile, java.lang.String xslFile)
      Transforms the given XML File by the given XSLT file, and returns the result from the XSL transformation in string format.
      abstract java.lang.String transformToString​(java.io.InputStream xmlStream, java.lang.String xslFile)
      Transforms the given XML InputStream by the given XSLT file, and returns the result from the XSL transformation in string format.
      abstract java.lang.String transformToString​(java.lang.String xmlString, java.lang.String xslFile)
      Transforms the given XML String by the given XSLT file, and returns the result from the XSL transformation in string format.
      abstract java.lang.String transformToString​(org.w3c.dom.Node xmlDoc, java.lang.String xslFile)
      Transforms the given XML Node by the given XSLT file, and returns the result from the XSL transformation in string format.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • XSLTSupport

        public XSLTSupport()
    • Method Detail

      • newInstance

        public static XSLTSupport newInstance()
        Returns an instance of an XSLTSupport object.
        Returns:
        A new XSLTSupport object.
      • transformToString

        public abstract java.lang.String transformToString​(java.lang.String xmlString,
                                                           java.lang.String xslFile)
                                                    throws XMLSupportException
        Transforms the given XML String by the given XSLT file, and returns the result from the XSL transformation in string format.
        Parameters:
        xmlString - An XML String.
        xslFile - The name of an XSL file.
        Returns:
        The result of the transformation, in String format.
        Throws:
        XMLSupportException - Signals an error occurred while tranforming.
      • transformToString

        public abstract java.lang.String transformToString​(java.io.File xmlFile,
                                                           java.lang.String xslFile)
                                                    throws XMLSupportException
        Transforms the given XML File by the given XSLT file, and returns the result from the XSL transformation in string format.
        Parameters:
        xmlFile - An XML File.
        xslFile - The name of an XSL file.
        Returns:
        The result of the transformation, in String format.
        Throws:
        XMLSupportException - Signals an error occurred while tranforming.
      • transformToString

        public abstract java.lang.String transformToString​(java.io.InputStream xmlStream,
                                                           java.lang.String xslFile)
                                                    throws XMLSupportException
        Transforms the given XML InputStream by the given XSLT file, and returns the result from the XSL transformation in string format.
        Parameters:
        xmlStream - An XML inputStream.
        xslFile - The name of an XSL file.
        Returns:
        The result of the transformation, in String format.
        Throws:
        XMLSupportException - Signals an error occurred while tranforming.
      • transformToString

        public abstract java.lang.String transformToString​(org.w3c.dom.Node xmlDoc,
                                                           java.lang.String xslFile)
                                                    throws XMLSupportException
        Transforms the given XML Node by the given XSLT file, and returns the result from the XSL transformation in string format.
        Parameters:
        xmlDoc - An XML DOM Node.
        xslFile - The name of an XSL file.
        Returns:
        The result of the transformation, in String format.
        Throws:
        XMLSupportException - Signals an error occurred while tranforming.
      • setXSLCaching

        public abstract void setXSLCaching​(boolean cachingIsOn)
        Sets the status of XSL caching on this class, if the underlying XSL processor implements such functionality. If this is set to true, then the XSL will be cached in memory. This generally results in a boost in speed, at the cost of not being able to detect changes in the XSL file while the in-memory cache is active(the lifetime of the JVM).
        Parameters:
        cachingIsOn - True if caching should be on, false if it should be off.
      • getXSLCaching

        public abstract boolean getXSLCaching()
        Returns the current status of XSL caching on this class.
        Returns:
        Whether XSL caching is currently active on this object.
      • transformToNode

        public abstract org.w3c.dom.Node transformToNode​(java.lang.String xmlString,
                                                         java.io.InputStream stream)
                                                  throws XMLSupportException
        Transforms the given XML String by the given XSLT InputStream, and returns the result from the XSL transformation as a DOM Node.
        Parameters:
        xmlString - An XML String.
        stream - An InputStream containing an XSLT transform.
        Returns:
        The result of the transformation, in DOM Node format.
        Throws:
        XMLSupportException - Signals an error occurred while tranforming.
        Since:
        MicroStrategy Web 8.0.0
      • transformToNode

        public abstract org.w3c.dom.Node transformToNode​(org.w3c.dom.Node xmlDoc,
                                                         java.io.InputStream stream)
                                                  throws XMLSupportException
        Transforms the given XML DOM Node by the given XSLT file, and returns the result from the XSL transformation as a DOM Node.
        Parameters:
        xmlDoc - An XML Node.
        stream - An InputStream containing an XSLT transform.
        Returns:
        The result of the transformation, in DOM Node format.
        Throws:
        XMLSupportException - Signals an error occurred while tranforming.
        Since:
        MicroStrategy Web 8.0.0
      • transformToNode

        public abstract org.w3c.dom.Node transformToNode​(java.lang.String xmlString,
                                                         java.lang.String xslFile)
                                                  throws XMLSupportException
        Transforms the given XML String by the given XSLT file, and returns the result from the XSL transformation as a DOM Node.
        Parameters:
        xmlString - An XML String.
        xslFile - The name of an XSL file.
        Returns:
        The result of the transformation, in DOM Node format.
        Throws:
        XMLSupportException - Signals an error occurred while tranforming.
      • transformToNode

        public abstract org.w3c.dom.Node transformToNode​(org.w3c.dom.Node xmlDoc,
                                                         java.lang.String xslFile)
                                                  throws XMLSupportException
        Transforms the given XML DOM Node by the given XSLT file, and returns the result from the XSL transformation as a DOM Node.
        Parameters:
        xmlDoc - An XML Node.
        xslFile - The name of an XSL file.
        Returns:
        The result of the transformation, in DOM Node format.
        Throws:
        XMLSupportException - Signals an error occurred while tranforming.
      • transformToFile

        public abstract void transformToFile​(java.io.File xmlFile,
                                             java.lang.String xslFile,
                                             java.lang.String outputFile)
                                      throws XMLSupportException
        Transforms the given XML file using the given XSL file and writes the result into the specified output file
        Parameters:
        xmlFile - XML file that needs to be transformed File
        xslFile - Path of the XSL file that needs to be used for the transformation
        outputFile - Path of the output file that needs to be created or over-written that is a result of the transformation.
        Throws:
        XMLSupportException
        Since:
        MicroStrategy Web 8.0.2