ilene 2003/04/02 10:23:14
Modified: java/src/org/apache/xalan/xsltc/trax
TransformerFactoryImpl.java
Log:
If there is an error listener registered to a TransformerFactory, and the
stylesheet cannot be compiled, call fatalError, in addition to throwing
the TransformerConfigurationException.
Revision Changes Path
1.61 +24 -12
xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
Index: TransformerFactoryImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- TransformerFactoryImpl.java 31 Mar 2003 13:13:09 -0000 1.60
+++ TransformerFactoryImpl.java 2 Apr 2003 18:23:14 -0000 1.61
@@ -735,17 +735,29 @@
}
// Check that the transformation went well before returning
- if (bytecodes == null) {
- // Pass compiler errors to the error listener
- if (_errorListener != null) {
- passErrorsToListener(xsltc.getErrors());
- }
- else {
- xsltc.printErrors();
- }
- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR);
- throw new TransformerConfigurationException(err.toString());
- }
+ if (bytecodes == null) {
+
+ ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_COMPILE_ERR);
+ TransformerConfigurationException exc = new
TransformerConfigurationException(err.toString());
+
+ // Pass compiler errors to the error listener
+ if (_errorListener != null) {
+ passErrorsToListener(xsltc.getErrors());
+
+ // As required by TCK 1.2, send a fatalError to the
+ // error listener because compilation of the stylesheet
+ // failed and no further processing will be possible.
+ try {
+ _errorListener.fatalError(exc);
+ } catch (TransformerException te) {
+ // well, we tried.
+ }
+ }
+ else {
+ xsltc.printErrors();
+ }
+ throw exc;
+ }
return new TemplatesImpl(bytecodes, transletName,
xsltc.getOutputProperties(), _indentNumber, this);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]