--- XSLTProcessorImpl.org	Wed Dec 12 15:24:59 2001
+++ XSLTProcessorImpl.java	Wed Dec 12 15:24:59 2001
@@ -151,9 +151,9 @@
     throws ProcessingException
   {
     try {
-      Templates templates = getTemplates(stylesheet);
+      InputSource is = stylesheet.getInputSource();
+      Templates templates = getTemplates(stylesheet, is);
       if(templates == null) {
-        InputSource is = stylesheet.getInputSource();
         getLogger().debug("Creating new Templates in " + this + " for " + is);
         if (is.getSystemId() != null)
           getLogger().debug("  with system id " + is.getSystemId());
@@ -188,10 +188,10 @@
         // Get the Templates object (generated during the parsing of
         // the stylesheet) from the TemplatesHandler.
         templates = templatesHandler.getTemplates();
-        putTemplates (templates, stylesheet);
+        putTemplates (templates, stylesheet, is);
       } else {
         getLogger().debug("Reusing Templates in " + this + " for "
-                          + stylesheet.getInputSource().getSystemId());
+                          + is.getSystemId());
       }
 
       TransformerHandler handler
@@ -200,10 +200,9 @@
         /* If there is a problem in getting the handler, try using a
          * brand new Templates object */
         getLogger().debug("Re-creating new Templates in " + this + " for"
-                          + stylesheet.getInputSource().getSystemId());
-        InputSource is = stylesheet.getInputSource();
+                          + is.getSystemId());
         templates = getTransformerFactory().newTemplates(new SAXSource(is));
-        putTemplates (templates, stylesheet);
+        putTemplates (templates, stylesheet, is);
         handler = getTransformerFactory().newTransformerHandler(templates);
       }
 
@@ -281,7 +280,7 @@
     return tfactory;
   }
 
-  private Templates getTemplates(Source stylesheet)
+  private Templates getTemplates(Source stylesheet, InputSource is)
     throws IOException, ProcessingException
   {
     Templates templates = null;
@@ -289,7 +288,6 @@
     if (useStore == false)
       return null;
 
-    InputSource is = stylesheet.getInputSource();
     getLogger().debug("XSLTProcessorImpl getTemplates: stylesheet "
                       + is.getSystemId());
 
@@ -322,7 +320,7 @@
    return templates;
   }
 
-  private void putTemplates (Templates templates, Source stylesheet)
+  private void putTemplates (Templates templates, Source stylesheet, InputSource is)
     throws IOException, ProcessingException
   {
     if (useStore == false)
@@ -335,7 +333,7 @@
       Object[] templateAndTime = new Object[2];
       templateAndTime[0] = templates;
       templateAndTime[1] = new Long(stylesheet.getLastModified());
-      store.hold(stylesheet.getInputSource().getSystemId(), templateAndTime);
+      store.hold(is.getSystemId(), templateAndTime);
     }
   }
 

