code: public void endDocument() throws org.xml.sax.SAXException
    {
  
      try
      {
        if (null != getStylesheetRoot())
        {
          if (0 == m_stylesheetLevel)
            getStylesheetRoot().recompose();        
        }
        else
          throw new TransformerException(XSLMessages.createMessage(XSLTErrorResources.ER_NO_STYLESHEETROOT, null)); //"Did not find the stylesheet root!");
  
        XSLTElementProcessor elemProcessor = getCurrentProcessor();
  
        if (null != elemProcessor)
          elemProcessor.startNonText(this);
  
        m_stylesheetLevel--;			
        
        popSpaceHandling();
  
        // WARNING: This test works only as long as stylesheets are parsed
        // more or less recursively. If we switch to an iterative "work-list"
        // model, this will become true prematurely. In that case,
        // isStylesheetParsingComplete() will have to be adjusted to be aware
        // of the worklist.
        m_parsingComplete = (m_stylesheetLevel < 0);
      }
      catch (TransformerException te)
      {
        throw new org.xml.sax.SAXException(te);
      }
    }
docs: Receive notification of the end of the document.
  
  @see org.xml.sax.ContentHandler#endDocument
  
  @throws org.xml.sax.SAXException Any SAX exception, possibly
  wrapping another exception.