Class XsltErrorUtils
- java.lang.Object
-
- org.ikasan.component.converter.xml.util.XsltErrorUtils
-
public class XsltErrorUtils extends java.lang.ObjectThis class provides a range of static XSLT utility methods for error handling.- Author:
- Ikasan Development Team
-
-
Constructor Summary
Constructors Constructor Description XsltErrorUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidthrowException(java.lang.String message)Throws an Exception with the specified detail message.static voidthrowTrivialException(java.lang.String message)Utility method for handling XSLT errors that we dont want to stop things
-
-
-
Method Detail
-
throwException
public static void throwException(java.lang.String message) throws javax.xml.transform.TransformerExceptionThrows an Exception with the specified detail message. *# ============================================= # Stylesheet for throwException() # ============================================= <?xml version="1.0"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xslt" xmlns:error="xalan://org.ikasan.framework.component.xslt.util.XsltErrorUtils" version="1.0" exclude-result-prefixes="xalan error"> <xsl:output method="xml" encoding="UTF-8" indent="yes" xalan:indent-amount="2"/> <xsl:template match="/"> <xsl:element name="xyz"> <xsl:element name="newElement"> <xsl:choose> <xsl:when test="/root/data[1]/j"> <xsl:value-of select ="/root/data[1]/j"/> </xsl:when> <xsl:otherwise> <xsl:value-of select ="error:throwException('Element /root/data[1]/j not found.')"/> </xsl:otherwise> </xsl:choose> </xsl:element> </xsl:element> </xsl:template> </xsl:stylesheet>- Parameters:
message- is the detail message.- Throws:
javax.xml.transform.TransformerException
-
throwTrivialException
public static void throwTrivialException(java.lang.String message) throws javax.xml.transform.TransformerExceptionUtility method for handling XSLT errors that we dont want to stop things- Parameters:
message-- Throws:
javax.xml.transform.TransformerException
-
-