You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Anne Chinn <An...@Ingeniux.com> on 2000/12/20 23:04:57 UTC

is this a bug?

On WindowsNT:


I am attempting to call XSLTEngineImpl::process. 
There is a problem with my stylesheet that triggers an error through the
method XSLTEngineImpl::problem. This method attempts to throws an
XSLTProcessorException with the message "xsl template requires either a name
or a match attribute".

The XSLTProcessorException gets caught by the catch (...) in
StylesheetHandler::startElement.
There's a big comment at the beginning of the catch cases here that says
that you need to save off the error message and process it later in
endDocument.
The problem is that there are only two catch cases, SAXException and the
catch all.  There is no handler for XSLTProcessorException so it's being
caught by the default and the message is lost.  When I continue from here
xalan eventually gets an access violation.

I tried adding a case for the XSLTProcessorException and had it do the same
thing that happens for the SAXException. This works better, in that it
doesn't crash, but it still loses the original error message and the message
that gets up to the user is 'Failed to process stylesheet!". I followed the
exceptions to XSLTEngineImpl::process and found the following:

		try
		{
			m_stylesheetRoot =
processStylesheet(stylesheetSource, constructionContext);
		}
		catch(const XSLException&)
		{
		}
		catch(const SAXException&)
		{
		}
		catch(const XMLException&)
		{
		}

so the exception that was thrown is lost.  

Is this a known problem?

Thanks,

Anne Chinn