Class CmsXsltUtil

java.lang.Object
org.opencms.util.CmsXsltUtil

public final class CmsXsltUtil extends 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 Details

  • Method Details

    • getPreferredDelimiter

      public static String getPreferredDelimiter(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 String transformCsvContent(CmsObject cms, String xsltFile, String csvContent, 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 String transformXmlContent(CmsObject cms, String xsltFile, 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