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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
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
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