logo       

Re: [saxon - Help] RE: Setting ErrorListener has no effect: msg#00122

text.xml.saxon.help

Subject: Re: [saxon - Help] RE: Setting ErrorListener has no effect

Oh. I still use Saxon 7.8 despite all the chatter. ErrorListener

class Errors implements ErrorListener{...}

System.setProperty("javax.xml.transform.TransformerFactory",
"net.sf.saxon.TransformerFactoryImpl");
TransformerFactory tFactory = TransformerFactory.newInstance();
err = new Errors(xsl, path);
tFactory.setErrorListener(err);

This is very abbreviated code but covers the heart of the matter.
Hmm. But maybe I'm wrong about this. Later on in the code before the
transformer transform() method is called, I do

err = new Errors(xsl, path);
transformer.setErrorListener(err);

Even later down I see;

catch(Exception e){
// isError set by errorListener and avoid recursion on a bad
error stylesheet
if(isError && !xsl.equalsIgnoreCase(path + errorStyleSheet)){
transform(path + errorStyleSheet);
}

Which, in my case, starts another transform that reports the error to
the browser through servletResponse. This only reports the first error
which is usually the one I'm intereseted in as hundreds of subsequent
errors may be reported but aren't of any interest.

Now I'm starting to think that one chunk of code here is useless but I
don't know which one.

I use the identical code with Saxon 8.4 (yes, I actually use that
version) and it does the same thing. If anyone can see something stupid
I'm doing, I'd like to hear.

HTH,

Roger Kovack


SourceForge.net wrote:

Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=3205858
By: mhkay

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

______________________________________________________________________
You are receiving this email because you elected to monitor this forum.
To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=94027






-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise