Project

Profile

Help

Configure error listener per executable.

Added by Anonymous almost 15 years ago

Legacy ID: #7164043 Legacy Poster: Talmage (qnox)

I compile and run XSL sheets each in their own java.lang.Runnable instance. I have my runner class implement the error listener class so each runnable instance can track errors related to its compilation and execution. I am able to track errors related to compilation just fine. However, if an error occurs during execution of the transformation the default Saxon error handler is called, printing the error to the standard error stream and throwing an exception. What do I need to do to set the error handler used for execution errors as I did for compile errors? public void run() { //myGlobalSaxonProcessor is shared application wide in a static member. XsltCompiler comp = myGlobalSaxonProcessor.newXsltCompiler(); //This works great, I am able to catch/handle compiler errors. comp.setErrorListener(this); XsltTransformer trans = comp.compile(mySource).load(); /* What do I need to do here to catch errors and preven the default error handler from printing errors to the standard error stream? */ trans.transform(); }


Replies (4)

Please register to reply

RE: Configure error listener per executable. - Added by Anonymous almost 15 years ago

Legacy ID: #7165591 Legacy Poster: Michael Kay (mhkay)

You can do ((Controller)trans.getUnderlyingController()).setErrorListener(listener) I'm not sure why this capability isn't exposed directly in the s9api API. Usually if I left things out it was because I thought the design could be improved and didn't want to make decisions too hastily. I'll look at it again.

RE: Configure error listener per executable. - Added by Anonymous almost 15 years ago

Legacy ID: #7168575 Legacy Poster: Michael Kay (mhkay)

I have added XsltTransformer.setErrorListener() and getErrorListener() for the 9.2 release.

RE: Configure error listener per executable. - Added by Anonymous almost 15 years ago

Legacy ID: #7181948 Legacy Poster: Talmage (qnox)

Thanks for the quick replies and the support, really is appreciated. Do you have an estimated time on the 9.2 release?

RE: Configure error listener per executable. - Added by Anonymous almost 15 years ago

Legacy ID: #7181990 Legacy Poster: Michael Kay (mhkay)

>Do you have an estimated time on the 9.2 release? It's been a month away for some months. I keep cramming more goodies in.

    (1-4/4)

    Please register to reply