cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geert Van Damme" <GVDA...@vdab.be>
Subject Re: custom transformer
Date Wed, 18 Jun 2003 07:42:44 GMT

Thanks for the tip, but after playing around with it I realize that I'm mixing up two different
things.
If I throw the SAXException, the rest of the original pipeline is still executed, after which
the error pipeline is executed. What I want is to stop the original pipeline from the moment
the exception is thrown, and thus not do any other transformations (this is required 'cause
one transformer does some FTP stuff).

To make things clearer :
I'm starting from an XSP using esql to fetch fields from database. When an error occurs on
database level (<esql:error-results>), the current pipeline may NOT be executed any
further, but a new pipeline should be activated (this is why I thought I could invoke the
error pipeline).

Any suggestions ? Could I use redirects inside the <esql:error-results> tag ? Or is
there a better solution ?

Thanks again !


>>> bdelacretaz@codeconsult.ch 06/17/03 04:39pm >>>
Le Mardi, 17 juin 2003, à 16:09 Europe/Zurich, Martin Holz a écrit :

> "Geert Van Damme" <GVDAMME@vdab.be> writes:
>
>> Hi,
>>
>> I'm writing a custom transformer, extending the 
>> AbstractDOMTransformer. Is there a way to throw an exception from 
>> this transformer so that the error handling pipeline of the sitemap 
>> is 'activated' ? (the transform method signature does not throw an 
>> exception). Or is the error handling from the sitemap only meant for 
>> SAXExceptions ?
>>
>
> Any checked exception in setup or any of the ContentHandler methods 
> should activate
> the error pipline. If you can't throw a ProcessingException in setup, 
> wrap a SAXException
> around your real exception.

In the case of AbstractDOMTransformer, transform() doesn't declare any 
exceptions (which it should IMO), so you might have to rewrite the 
notify() method in your transformer so that your transformation 
operation can throw exceptions.

-Bertrand

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org 
For additional commands, e-mail: cocoon-users-help@xml.apache.org 



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Mime
View raw message