avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/xslt XSLTProcessor.java XSLTProcessorImpl.java
Date Thu, 25 Apr 2002 07:09:54 GMT
cziegeler    02/04/25 00:09:53

  Modified:    xmlbundle/src/java/org/apache/avalon/excalibur/xml/xslt
                        XSLTProcessor.java XSLTProcessorImpl.java
  Log:
  Changed handling of source resolver
  
  Revision  Changes    Path
  1.2       +1 -10     jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/xslt/XSLTProcessor.java
  
  Index: XSLTProcessor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/xslt/XSLTProcessor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XSLTProcessor.java	24 Apr 2002 18:23:27 -0000	1.1
  +++ XSLTProcessor.java	25 Apr 2002 07:09:53 -0000	1.2
  @@ -65,7 +65,7 @@
    *
    * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
    * @author <a href="mailto:proyal@apache.org">Peter Royal</a>
  - * @version CVS $Id: XSLTProcessor.java,v 1.1 2002/04/24 18:23:27 proyal Exp $
  + * @version CVS $Id: XSLTProcessor.java,v 1.2 2002/04/25 07:09:53 cziegeler Exp $
    * @version 1.0
    * @since   July 11, 2001
    */
  @@ -75,15 +75,6 @@
        * The role implemented by an <code>XSLTProcessor</code>.
        */
       String ROLE = XSLTProcessor.class.getName();
  -
  -    /**
  -     * Set the {@link org.apache.excalibur.source.SourceResolver} for
  -     * this instance. The <code>resolver</code> is invoked to return a
  -     * <code>Source</code> object, given an HREF.
  -     *
  -     * @param resolver a <code>SourceResolver</code> value
  -     */
  -    void setSourceResolver( SourceResolver resolver );
   
       /**
        * <p>Return a <code>TransformerHandler</code> for a given
  
  
  
  1.2       +15 -11    jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/xslt/XSLTProcessorImpl.java
  
  Index: XSLTProcessorImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-excalibur/xmlbundle/src/java/org/apache/avalon/excalibur/xml/xslt/XSLTProcessorImpl.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- XSLTProcessorImpl.java	24 Apr 2002 18:23:27 -0000	1.1
  +++ XSLTProcessorImpl.java	25 Apr 2002 07:09:53 -0000	1.2
  @@ -100,7 +100,7 @@
    *
    * @author <a href="mailto:ovidiu@cup.hp.com">Ovidiu Predescu</a>
    * @author <a href="mailto:proyal@apache.org">Peter Royal</a>
  - * @version CVS $Id: XSLTProcessorImpl.java,v 1.1 2002/04/24 18:23:27 proyal Exp $
  + * @version CVS $Id: XSLTProcessorImpl.java,v 1.2 2002/04/25 07:09:53 cziegeler Exp $
    * @version 1.0
    * @since   July 11, 2001
    */
  @@ -125,8 +125,12 @@
       /** Is incremental processing turned on? (default for Xalan: no) */
       protected boolean incrementalProcessing = false;
   
  +    /** The source resolver */
       protected SourceResolver resolver;
   
  +    /** The error handler for the transformer */
  +    protected TraxErrorHandler errorHandler;
  +
       /**
        * Compose. Try to get the store
        */
  @@ -136,6 +140,8 @@
           this.manager = manager;
           this.getLogger().debug( "XSLTProcessorImpl component initialized." );
   //        this.store = (Store)manager.lookup(Store.TRANSIENT_CACHE);
  +        this.errorHandler = new TraxErrorHandler( this.getLogger() );
  +        this.resolver = (SourceResolver)this.manager.lookup( SourceResolver.ROLE );
       }
   
       /**
  @@ -143,11 +149,14 @@
        */
       public void dispose()
       {
  -//        if (this.manager != null) {
  +        if ( null != this.manager )
  +        {
  +            this.manager.release( this.resolver );
  +            this.resolver = null;
   //            this.manager.release(this.store);
   //            this.store = null;
  -//        }
  -
  +        }
  +        this.errorHandler = null;
           this.manager = null;
           this.tfactoryClass = null;
           this.tfactory = null;
  @@ -261,7 +270,7 @@
               }
               */
   
  -            handler.getTransformer().setErrorListener( new TraxErrorHandler( getLogger()
) );
  +            handler.getTransformer().setErrorListener( this.errorHandler );
   
               return handler;
           }
  @@ -368,7 +377,7 @@
               {
                   tfactory = ( SAXTransformerFactory ) tfactoryClass.newInstance();
               }
  -            tfactory.setErrorListener( new TraxErrorHandler( getLogger() ) );
  +            tfactory.setErrorListener( this.errorHandler );
               tfactory.setURIResolver( this );
               // TODO: If we will support this feature with a different
               // transformer than Xalan we'll have to set that corresponding
  @@ -519,11 +528,6 @@
           {
               this.resolver.release( xslSource );
           }
  -    }
  -
  -    public void setSourceResolver( SourceResolver resolver )
  -    {
  -        this.resolver = resolver;
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message