xsl-list
[Top] [All Lists]

Re: [xsl] Evaluating a return value or throwing an exception

2007-05-25 01:56:33
On 5/25/07, didis5(_at_)gmx(_dot_)de <didis5(_at_)gmx(_dot_)de> wrote:
Sorry, I posted the question below from another account and I don't know if it 
will be read cause I registered this email address. So this is a copy of my 
former email.
--------------------------------
Hello,

I want to cancle an xslt-Transformation, if a condition is fulfilled. This 
condition I can evaluate at runtime, when executing the xsl-script.
With xsl:message I can rise a message, but I want to evaluate the response in 
the java code, cause the result of the transformation is not important, if the 
condition is not fulfilled.

So I need a return value or an exception, so that I can see outside of the 
transformation, that it was canceled.

Is there a possibility to set a parameter in the script, which can be accessed 
from outside or is there a possibility to throw an exception in the script?

Im using Java, Xalan-J-2.7.0

You could just write your XSLT to finish if the condition is met,
returning a value in the result that you check for eg:

<xsl:choose>
 <xsl:when test="condition is met">false</when>
 <xsl:otherwise> continue processing .... </xsl:otherwise>

If the result of the transform is "false" then you know the condition was met.

cheers
andrew

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>