Package org.apache.xalan.stree

Examples of org.apache.xalan.stree.SourceTreeHandler


      this.m_exceptionThrown = null;

      if (inputHandler instanceof SourceTreeHandler)
      {
        SourceTreeHandler sth = (SourceTreeHandler) inputHandler;

        sth.setInputSource(source);
        sth.setUseMultiThreading(true);

        Node doc = sth.getRoot();

        if (null != doc)
        {
          SourceTreeManager stm = getXPathContext().getSourceTreeManager();
          stm.putDocumentInCache(doc, source);
View Full Code Here


  public ContentHandler getInputContentHandler(boolean doDocFrag)
  {

    if (null == m_inputContentHandler)
    {
      m_inputContentHandler = new SourceTreeHandler(this, doDocFrag);
      ((SourceTreeHandler)m_inputContentHandler).setUseMultiThreading(true);
    }

    return m_inputContentHandler;
  }
View Full Code Here

    // If this is an Stree instance, handle it with SourceTreeHandler
    // and bypass the whole DOM process.
    boolean isSTree = (sourceNode instanceof org.apache.xalan.stree.Child);
    if (isSTree)
    {     
      rtfHandler = new SourceTreeHandler(this, true);
      ((SourceTreeHandler)rtfHandler).setUseMultiThreading(false);
      ((SourceTreeHandler)rtfHandler).setShouldTransformAtEnd(false);
      // Create a ResultTreeFrag object.
      resultFragment = (DocumentFragment)((SourceTreeHandler)rtfHandler).getRoot();
      // ((org.apache.xalan.stree.DocumentFragmentImpl)resultFragment).setComplete(true);    
View Full Code Here

//      e.printStackTrace();
//    }
     
    if (m_inputContentHandler instanceof SourceTreeHandler)
    {
      SourceTreeHandler sth = (SourceTreeHandler) m_inputContentHandler;

      sth.setExceptionThrown(e);
    }
    ContentHandler ch = getContentHandler();
    if(ch instanceof SourceTreeHandler)
    {
      SourceTreeHandler sth = (SourceTreeHandler) ch;
      ((TransformerImpl)(sth.getTransformer())).postExceptionFromThread(e);
    }

    m_isTransformDone = true;
    m_exceptionThrown = e;
    ;  // should have already been reported via the error handler?
View Full Code Here

      // System.out.println("reading: "+source.getSystemId());
      XMLReader reader = getXMLReader(source, locator);

      // TODO: Need to use factory of some kind to create the ContentHandler
      // (Also, try using JAXP if need be...)
      ContentHandler handler = new SourceTreeHandler();

      if (handler instanceof org.apache.xalan.stree.SourceTreeHandler)
      {

        // temp hack
View Full Code Here

          // Get the input content handler, which will handle the
          // parse events and create the source tree.         
          //StylesheetHandler inputHandler = (StylesheetHandler)m_processor.getTemplatesBuilder();
          //reader.setContentHandler( inputHandler );
         
          SourceTreeHandler handler = new SourceTreeHandler();
          reader.setContentHandler(handler);
          reader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
       
          // Kick off the parse.  When the ContentHandler gets
          // the startDocument event, it will call transformNode( node ).
          reader.parse( SAXSource.sourceToInputSource(iSource));
          sourceTree = handler.getRoot();
        }
      }
      catch(Exception e)
      {
        // Unwrap exception
View Full Code Here

   * Set the output stream. Required when the XSLTProcessor is being used
   * as a SAX DocumentHandler.
   */
  public void setOutputStream(java.io.OutputStream os)
  {
    SourceTreeHandler handler = new SourceTreeHandler(m_transformerImpl);
    handler.setResult(new StreamResult(os));  
  }
View Full Code Here

          // Get the input content handler, which will handle the
          // parse events and create the source tree.         
          //StylesheetHandler inputHandler = (StylesheetHandler)m_processor.getTemplatesBuilder();
          //reader.setContentHandler( inputHandler );
         
          SourceTreeHandler handler = new SourceTreeHandler();
          reader.setContentHandler(handler);
          reader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
       
          // Kick off the parse.  When the ContentHandler gets
          // the startDocument event, it will call transformNode( node ).
          reader.parse( SAXSource.sourceToInputSource(iSource));
          sourceTree = handler.getRoot();
        }
      }
      catch(Exception e)
      {
        // Unwrap exception
View Full Code Here

   * Set the output stream. Required when the XSLTProcessor is being used
   * as a SAX DocumentHandler.
   */
  public void setOutputStream(java.io.OutputStream os)
  {
    SourceTreeHandler handler = new SourceTreeHandler(m_transformerImpl);
    handler.setResult(new StreamResult(os));  
  }
View Full Code Here

      this.m_exceptionThrown = null;

      if (inputHandler instanceof SourceTreeHandler)
      {
        SourceTreeHandler sth = (SourceTreeHandler) inputHandler;

        sth.setInputSource(source);
        sth.setUseMultiThreading(true);

        Node doc = sth.getRoot();

        if (null != doc)
        {
          SourceTreeManager stm = getXPathContext().getSourceTreeManager();
          stm.putDocumentInCache(doc, source);
View Full Code Here

TOP

Related Classes of org.apache.xalan.stree.SourceTreeHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.