Package org.opencms.util
Class CmsXsltUtil
- java.lang.Object
-
- org.opencms.util.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.
-
-
-
Field Detail
-
TAG_END_DELIMITER
public static final java.lang.String TAG_END_DELIMITER
The delimiter to end a tag.- See Also:
- Constant Field Values
-
TAG_START_DELIMITER
public static final java.lang.String TAG_START_DELIMITER
The delimiter to start a tag.- See Also:
- Constant Field Values
-
TEXT_DELIMITER
public static final char TEXT_DELIMITER
The delimiter to separate the text.- See Also:
- Constant Field Values
-
-
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 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 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 objectxsltFile
- the XSLT transformation filexmlContent
- the XML content to transform- Returns:
- the transformed xml
- Throws:
CmsXmlException
- if something goes wrongCmsException
- if something goes wrong
-
-