Thanks,

I had figured out that I needed an ErrorListener, so I registered a simple class with the Transformer, but not the TransformerFactory.

It's working very nicely for me now that I registered it with both.

/John

Michael Kay wrote:
You need to register an ErrorListener with the TransformerFactory (or with
Saxon's Configuration object which underpins the TransformerFactory). The
errors will then be notified to the ErrorListener instead of being written
to System.err.

That's for compile-time errors. For run-time errors you need to register an
ErrorListener with the Transformer.

Catching the exception will only give you the summary at the end that says
whether the compilation (or execution) succeeded or failed.

Michael Kay 

  
-----Original Message-----
From: saxon-help-bounces@lists.sourceforge.net 
[mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf 
Of John McGowan
Sent: 25 July 2006 22:28
To: saxon-help@lists.sourceforge.net
Subject: [saxon] Catching Detailed Error Information

I've incorporated Saxon into a Bean that gets called by an 
application server.  There is really useful information that 
shows up on the console of the running App server like this....

    
Error on line 39 column 7
  SXXP0003: Error reported by XML parser: The element type 
      
"test" must 
    
be terminated by the
  matching end-tag "</test>".
      
I want that information to be output by my bean when there is 
an error, but I'm not sure how to get it.  This is what I 
have in my catch clause right now.

    
catch (TransformerException te) {
            String rvalue = "XSL ";
            rvalue += "<!-- ";
            rvalue += te.getMessageAndLocation();
            rvalue += " --> Error";
            return rvalue;
        }
      
do i need to do a getCause() to get to the bottom of it?

I appreciate any help with this...

-- 


John McGowan
mcgowan@lynch2.com
P 847.608.6900 x 110
F 847.608.9501


--------------------------------------------------------------
-----------
Take Surveys. Earn Cash. Influence the Future of IT Join 
SourceForge.net's Techsay panel and you'll get the chance to 
share your opinions on IT & business topics through brief 
surveys -- and earn cash 
http://www.techsay.com/default.php?page=join.php&p=sourceforge
    
&CID=DEVDEV
  
_______________________________________________
saxon-help mailing list
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help
    


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
saxon-help mailing list
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help

  

-- 


John McGowan
mcgowan@lynch2.com
P 847.608.6900 x 110
F 847.608.9501