m_stylesheetRoot = createStylesheetRoot(stylesheetSource.getSystemId()); addTraceListenersToStylesheet();
  public StylesheetRoot processStylesheet(XSLTInputSource stylesheetSource)    throws SAXException  {    try{      if(null != ((TransformerFactoryImpl)m_tfactory).newTemplatesHandler().getTemplates())        reset();    }    catch (TransformerConfigurationException tce)    {      throw new SAXException(tce);    }    String xslIdentifier = ((null == stylesheetSource) ||                            (null == stylesheetSource.getSystemId()))                           ? "Input XSL" : stylesheetSource.getSystemId();    // In case we have a fragment identifier, go ahead and    // try and parse the XML here.    m_stylesheetRoot = null;    try    {      m_stylesheetRoot = createStylesheetRoot(stylesheetSource.getSystemId());      addTraceListenersToStylesheet();      StylesheetHandler stylesheetProcessor        = new StylesheetHandler((TransformerFactoryImpl)m_tfactory); //this, m_stylesheetRoot);       Source ssSource = stylesheetSource.getSourceObject();      if(ssSource instanceof DOMSource)      {        if(((DOMSource)ssSource).getNode() instanceof StylesheetRoot)        {          m_stylesheetRoot = (StylesheetRoot)((DOMSource)ssSource).getNode();        }        else        {          TreeWalker tw = new TreeWalker(stylesheetProcessor);          tw.traverse(((DOMSource)ssSource).getNode());          m_stylesheetRoot = new StylesheetRoot(stylesheetProcessor.getStylesheetRoot());        }      }      else      {        stylesheetProcessor.pushStylesheet(m_stylesheetRoot.getObject());              diag("========= Parsing "+xslIdentifier+" ==========");        pushTime(xslIdentifier);        //String liaisonClassName = System.getProperty("org.apache.xalan.source.liaison");        if(null != m_liaison)        {         // DOM2Helper liaison =  (DOM2Helper)(Class.forName(liaisonClassName).newInstance());          m_liaison.parse(SAXSource.sourceToInputSource(ssSource));        }          if(null != m_diagnosticsPrintWriter)          displayDuration("Parse of "+xslIdentifier, xslIdentifier);      }    }    catch(Exception e)    {      error(XSLTErrorResources.ER_COULDNT_PARSE_DOC, new Object[] {xslIdentifier}, e); //"Could not parse "+xslIdentifier+" document!", e);    }    return m_stylesheetRoot;  }