Menu

Setting ErrorListener has no effect

Help
2005-06-16
2012-10-08
  • James Michael Wright

    Hi,

    I am coming to the conclusion that setting an ErrorListener of my own on a Transformer has no effect if it is a Saxon 7.8 IdentifyTransformer (and quite possibly any other Saxon transformer). In order to control errors, I probably have to set the ErrorListener on the TransformerFactory.

    Is this a bug or a feature, or am I wrong about this?

    I have been looking at the sourcecode but not enough that I can walk you through it ;-) Well, actually you need to look at net.sf.saxon.Controller.

    Jim

     
    • Michael Kay

      Michael Kay - 2005-06-16

      Sorry, but it's now over 18 months since 7.8 was released and there have been another 6 releases since, so you can probably investigate this as easily as I can. I'd be surprised if you're right, though.

      Michael Kay

       
    • James Michael Wright

      Thanks. That was enough info. I appear to have confirmed that what I thought is true in 7.8 but not in b8-4.

      I worked around my problem with 7.8 by setting the error listener in a TransformerFactory.

      Calling 7.8 Controller.setErrorListener() does not change the error listener in the configuration which is used for most purposes.

      Jim Wright

       
      • Michael Kay

        Michael Kay - 2005-06-18

        Thanks for jogging my memory. The bug was that many dynamic errors were being reported to the TransformerFactory's error listener rather than to the Transformer's error listener. This was fixed a while ago and should be OK in recent releases.

        Michael Kay