vgritsenko 02/01/25 13:06:36 Modified: src/java/org/apache/cocoon/components/xslt XSLTProcessorImpl.java Log: These SAXExceptions giving me a hard time... Revision Changes Path 1.7 +10 -10 xml-cocoon2/src/java/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java Index: XSLTProcessorImpl.java =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/xslt/XSLTProcessorImpl.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- XSLTProcessorImpl.java 25 Jan 2002 03:42:29 -0000 1.6 +++ XSLTProcessorImpl.java 25 Jan 2002 21:06:36 -0000 1.7 @@ -27,6 +27,7 @@ import org.xml.sax.XMLFilter; import org.xml.sax.XMLReader; import org.xml.sax.ContentHandler; +import org.xml.sax.SAXException; import org.xml.sax.helpers.XMLReaderFactory; import javax.xml.transform.URIResolver; @@ -203,7 +204,6 @@ "Returns: Templates object capable of being used for transformation purposes, never null." if (handler == null) { - if (this.getLogger().isDebugEnabled()) { getLogger().debug("Re-creating new Templates for " + id); } @@ -219,8 +219,11 @@ return handler; } catch (ProcessingException e) { throw e; + } catch (SAXException e) { + getLogger().debug("Got SAXException. Rethrowing cause exception.", e); + throw new ProcessingException("Exception in creating Transform Handler", e.getException()); } catch (Exception e) { - throw new ProcessingException("Error in creating Transform Handler", e); + throw new ProcessingException("Exception in creating Transform Handler", e); } } @@ -288,13 +291,12 @@ private Templates getTemplates(Source stylesheet, String id) throws IOException, ProcessingException { - Templates templates = null; - if (!useStore) return null; getLogger().debug("XSLTProcessorImpl getTemplates: stylesheet " + id); + Templates templates = null; // only stylesheets with a last modification date are stored if (stylesheet.getLastModified() != 0) { @@ -312,11 +314,9 @@ } } } - } else { - // remove an old template if it exists - if (store.containsKey(id)) { + } else if (store.containsKey(id)) { + // remove an old template if it exists store.remove(id); - } } return templates; } @@ -401,9 +401,9 @@ return null; } catch (java.net.MalformedURLException mue) { return null; - } catch (java.io.IOException ioe) { + } catch (IOException ioe) { return null; - } catch (org.xml.sax.SAXException se) { + } catch (SAXException se) { throw new TransformerException(se); } catch (ProcessingException pe) { throw new TransformerException(pe);
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]