You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by cz...@apache.org on 2003/07/29 14:32:18 UTC

cvs commit: cocoon-2.1/src/java/org/apache/cocoon/transformation CIncludeTransformer.java

cziegeler    2003/07/29 05:32:18

  Modified:    .        status.xml
               src/java/org/apache/cocoon/transformation
                        CIncludeTransformer.java
  Log:
  Fix the ignoreErrors handling in the cinclude transformer
  
  Revision  Changes    Path
  1.99      +4 -2      cocoon-2.1/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/status.xml,v
  retrieving revision 1.98
  retrieving revision 1.99
  diff -u -r1.98 -r1.99
  --- status.xml	29 Jul 2003 09:01:01 -0000	1.98
  +++ status.xml	29 Jul 2003 12:32:18 -0000	1.99
  @@ -167,7 +167,9 @@
     <changes>
   
    <release version="@version@" date="@date@">
  -  <action dev="NN" type="add">Dummy action</action>
  +  <action dev="CZ" type="fix">
  +   Fix the ignoreErrors handling in the cinclude transformer.
  +  </action>
    </release>
    <release version="2.1rc1" date="July 29 2003">
     <action dev="VG" type="update">
  
  
  
  1.5       +22 -6     cocoon-2.1/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java
  
  Index: CIncludeTransformer.java
  ===================================================================
  RCS file: /home/cvs/cocoon-2.1/src/java/org/apache/cocoon/transformation/CIncludeTransformer.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- CIncludeTransformer.java	6 Jun 2003 12:21:55 -0000	1.4
  +++ CIncludeTransformer.java	29 Jul 2003 12:32:18 -0000	1.5
  @@ -375,22 +375,38 @@
                                 + ", parameters=" + this.resourceParameters);
               }
               Source source = null;
  +            
               try {
                   source = SourceUtil.getSource(resource, 
                                                 this.configurationParameters, 
                                                 this.resourceParameters,
                                                 this.resolver);
  -
  -                SourceUtil.toSAX(source, this.xmlConsumer, this.configurationParameters, true);
  -                
  +                                              
  +                XMLSerializer serializer = null;
  +                XMLDeserializer deserializer = null;
  +                try {
  +                    if ( ignoreErrors ) {
  +                        serializer = (XMLSerializer) this.manager.lookup(XMLSerializer.ROLE);
  +                        deserializer = (XMLDeserializer)this.manager.lookup(XMLDeserializer.ROLE);
  +                        SourceUtil.toSAX(source, serializer, this.configurationParameters, true);
  +                        deserializer.setConsumer( this.xmlConsumer );
  +                        deserializer.deserialize( serializer.getSAXFragment() );
  +                    } else {
  +                        SourceUtil.toSAX(source, this.xmlConsumer, this.configurationParameters, true);
  +                    }
  +                } catch (ProcessingException pe) {
  +                    if (!ignoreErrors) throw pe;
  +                } catch (ComponentException ignore) {
  +                } finally {
  +                    this.manager.release( serializer );
  +                    this.manager.release( deserializer );
  +                }               
               } catch (SourceException se) {
                   if (!ignoreErrors) throw SourceUtil.handle(se);
               } catch (SAXException se) {
                   if (!ignoreErrors) throw se;
               } catch (IOException ioe) {
                   if (!ignoreErrors) throw ioe;
  -            } catch (ProcessingException pe) {
  -                if (!ignoreErrors) throw pe;
               } finally {
                   this.resolver.release(source);
               }