Hi Don,

You can set the ProblemListener for the XalanTransformer instance, and most
errors (but not all, unfortunately) will come through the call.  See the
classes ProblemListenerDefault and XalanTransformerProblemListener for more
information.  The purpose of the latter is to allow re-direction of
warnings to a stream specified by the user.

However, since errors which have line number information should have that
information in the string returned by getLastError(), this may be a bug.
Can you describe what sort of error it is?

Dave



                                                                                
                                                              
                      "Don McClimans"                                           
                                                              
                      <[EMAIL PROTECTED]         To:      
<[email protected]>                                                  
 
                      ronics.com>                   cc:      (bcc: David N 
Bertoni/Cambridge/IBM)                                             
                                                    Subject: Getting the line 
and column number of an error                                   
                      01/08/2003 08:51 AM                                       
                                                              
                                                                                
                                                              



I want to show the line and column number any errors that occur during a
transform. Is there an easy way to do this?

I looked at Xalan.exe, which does report this information. But it's not in
the return string from getLastError(), rather,
XalanTransformer::transform()
seems to dump this information to cout or cerr. I guessed that this was
being done by the ProblemListener that is part of a XalanTransformer, but
when I call getProblemListnere(), it returns null.

I've browsed around the API docs for ProblemListener and
XalanTransformerProblemListener, but I haven't groked the "big picture" to
know what I should be using when. It seems like this should be simple, but
I'm confused. Please point me in the right direction! :)

Thanks,

Don McClimans



Reply via email to