Class CmsXsltUtil


  • public final class CmsXsltUtil
    extends java.lang.Object
    Provides utility functions for XSLT transformations.

    TODO: This class is apparently customer specific and should probably be removed from the core!

    Since:
    6.2.1
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String TAG_END_DELIMITER
      The delimiter to end a tag.
      static java.lang.String TAG_START_DELIMITER
      The delimiter to start a tag.
      static char TEXT_DELIMITER
      The delimiter to separate the text.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getPreferredDelimiter​(java.lang.String csvData)
      Returns the delimiter that most often occures in the CSV content and is therefore best applicable for the CSV data .
      static java.lang.String transformCsvContent​(CmsObject cms, java.lang.String xsltFile, java.lang.String csvContent, java.lang.String delimiter)
      Changes content from CSV to xml/html.
      static java.lang.String transformXmlContent​(CmsObject cms, java.lang.String xsltFile, java.lang.String xmlContent)
      Applies a XSLT Transformation to the content.
      • Methods inherited from class java.lang.Object

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

      • getPreferredDelimiter

        public static java.lang.String getPreferredDelimiter​(java.lang.String csvData)
        Returns the delimiter that most often occures in the CSV content and is therefore best applicable for the CSV data .

        Parameters:
        csvData - the comma separated values
        Returns:
        the delimiter that is best applicable for the CSV data
      • transformCsvContent

        public static java.lang.String transformCsvContent​(CmsObject cms,
                                                           java.lang.String xsltFile,
                                                           java.lang.String csvContent,
                                                           java.lang.String delimiter)
                                                    throws CmsException,
                                                           CmsXmlException
        Changes content from CSV to xml/html.

        The method does not use DOM4J, because iso-8859-1 code ist not transformed correctly.

        Parameters:
        cms - the cms object
        xsltFile - the XSLT transformation file
        csvContent - the csv content to transform
        delimiter - delimiter used to separate csv fields
        Returns:
        the transformed xml
        Throws:
        CmsXmlException - if something goes wrong
        CmsException - if something goes wrong
      • transformXmlContent

        public static java.lang.String transformXmlContent​(CmsObject cms,
                                                           java.lang.String xsltFile,
                                                           java.lang.String xmlContent)
                                                    throws CmsException,
                                                           CmsXmlException
        Applies a XSLT Transformation to the content.

        The method does not use DOM4J, because iso-8859-1 code ist not transformed correctly.

        Parameters:
        cms - the cms object
        xsltFile - the XSLT transformation file
        xmlContent - the XML content to transform
        Returns:
        the transformed xml
        Throws:
        CmsXmlException - if something goes wrong
        CmsException - if something goes wrong