if ((xslSource = getStylesheet(processor, request, xmlSource, listener)) == null)
if ((xslSource = getStylesheet(tFactory, request, xmlSource, listener)) == null)
  public void process(Processor processor, 					  HttpServletRequest request,                      HttpServletResponse response)    throws ServletException, IOException, SAXException  {    boolean debug = ourDefaultParameters.isDebug(request);    long time = 0;    if (debug)      time = System.currentTimeMillis();    // Listener to be used for all reporting    ApplyXSLTListener listener = new ApplyXSLTListener("ApplyXSLT");	listener.out.println("debug is " + debug);    InputSource xmlSource = null;	InputSource xslSource = null;    try    {      if ((xmlSource = getDocument(request, listener)) == null)        throw new ApplyXSLTException("getDocument() returned null",                                     new NullPointerException(),                                     response.SC_NOT_FOUND);    }    catch (ApplyXSLTException axe)    {      axe.appendMessage(EOL + "getDocument() resulted in ApplyXSLTException" + EOL                        + listener.getMessage());      if (debug) writeLog(axe);      displayException(response, axe, debug);      xmlSource = null;    }    // creating XSL Stylesheet    if (xmlSource != null)	{      try      {	    if ((xslSource = getStylesheet(processor, request, xmlSource, listener)) == null)		{          throw new ApplyXSLTException("getStylesheet() returned null",                                       new NullPointerException(),                                       response.SC_NOT_FOUND);        }        // For time being, must "reset" xmlSource after extracting stylesheet PI		xmlSource = getDocument(request, listener);       }      catch (ApplyXSLTException axe)      {        axe.appendMessage(EOL + "getStylesheet() resulted in ApplyXSLTException" + EOL                          + listener.getMessage());        if (debug) writeLog(axe);        displayException(response, axe, debug);        xslSource = null;      }    // perform Transformation	      if ((xmlSource != null) && (xslSource != null))    {	  try	  {        listener.out.println("Performing transformation...");		        Templates templates = processor.process(xslSource);        Transformer transformer = templates.newTransformer();	  	          {          try          {            String contentType = null;			contentType = getContentType(templates);            if (contentType != null);              response.setContentType(contentType);			if (transformer instanceof TransformerImpl)			{			  TransformerImpl transformerImpl = (TransformerImpl)transformer;              transformerImpl.setQuietConflictWarnings(ourDefaultParameters.isNoCW(request));			}						setStylesheetParams(transformer, request);				        transformer.transform(xmlSource, new Result(response.getOutputStream()));						if (debug)                            writeLog(listener.getMessage(), response.SC_OK);          }          catch (Exception exc)          {            ApplyXSLTException axe = new ApplyXSLTException				                     ("Exception occurred during Transformation:"                                          + EOL + listener.getMessage() + EOL                                          + exc.getMessage(), 									  exc,                                      response.SC_INTERNAL_SERVER_ERROR);            if (debug) writeLog(axe);            displayException(response, axe, debug);          }          finally          {            // transformer.reset();          } // end of try ... catch ... finally		}	  }      catch (/*org.xml.sax.SAX*/Exception saxExc)      {        ApplyXSLTException axe = new ApplyXSLTException			                     ("Exception occurred during ctor/Transformation:"                                             + EOL + listener.getMessage() + EOL                                             + saxExc.getMessage(), 								  saxExc,                                  response.SC_INTERNAL_SERVER_ERROR);        if (debug) writeLog(axe);        displayException(response, axe, debug);      } // end of new try ... catch    } // end of if((stylesheetRoot != null) ...    if (debug)    {      time = System.currentTimeMillis() - time;      writeLog("  No Conflict Warnings = " + ourDefaultParameters.isNoCW(request) +               "  Transformation time: " + time + " ms", response.SC_OK);    }  }  }  