Since I need to make a choice between a number of different exceptions to throw I used a xalan java extension, and then an exception selector in the handle-errors section.

This did the trick. In the transform I have defined <exception:statusCode200/> which will cause Java to throw a StatusCode200Exception which I can pick up in the handle-errors section and return <map:serialize type="xml" status-code="200"/>

Using the java extension allows me to easily define which error code that I wish to throw and to pick based on an xsl:if or xsl:choose.

Thanks for the advice, it worked out great,
Dan

Joerg Heinicke wrote:
On 10.04.2006 08:34, Bertrand Delacretaz wrote:

I don't think there is a standard way of throwing Exceptions from XSLT code, but calling a small Java extension class from XSLT to throw the Exception should do the trick, if you need to do this from XSLT.

I could not read from his message that he needs exceptions from XSLT, but there is an easy solution for it: <xsl:message terminate="yes"/>.

Regards,

Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to