Package org.opencms.util
Class CmsXsltUtil
java.lang.Object
org.opencms.util.CmsXsltUtil
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
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getPreferredDelimiter
(String csvData) Returns the delimiter that most often occures in the CSV content and is therefore best applicable for the CSV data .static String
transformCsvContent
(CmsObject cms, String xsltFile, String csvContent, String delimiter) Changes content from CSV to xml/html.static String
transformXmlContent
(CmsObject cms, String xsltFile, String xmlContent) Applies a XSLT Transformation to the content.
-
Field Details
-
TAG_END_DELIMITER
The delimiter to end a tag.- See Also:
-
TAG_START_DELIMITER
The delimiter to start a tag.- See Also:
-
TEXT_DELIMITER
The delimiter to separate the text.- See Also:
-
-
Method Details
-
getPreferredDelimiter
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 objectxsltFile
- the XSLT transformation filecsvContent
- the csv content to transformdelimiter
- delimiter used to separate csv fields- Returns:
- the transformed xml
- Throws:
CmsXmlException
- if something goes wrongCmsException
- 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 objectxsltFile
- the XSLT transformation filexmlContent
- the XML content to transform- Returns:
- the transformed xml
- Throws:
CmsXmlException
- if something goes wrongCmsException
- if something goes wrong
-