cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stevend...@apache.org
Subject svn commit: r734167 - in /cocoon/cocoon3/trunk: cocoon-optional/ cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/ cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/ cocoon-pipeline/src/test/java/org/apache/cocoon/pipe...
Date Tue, 13 Jan 2009 16:17:08 GMT
Author: stevendolg
Date: Tue Jan 13 08:14:56 2009
New Revision: 734167

URL: http://svn.apache.org/viewvc?rev=734167&view=rev
Log:
Moved all SAX related components to the new module cocoon-sax.

Added:
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractGenerator.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractGenerator.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractSerializer.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractSerializer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractTransformer.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractTransformer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractXMLProducer.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractXMLProducer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/CleaningTransformer.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/CleaningTransformer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/FileGenerator.java
      - copied, changed from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/FileGenerator.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/IncludeTransformer.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/IncludeTransformer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaErrorHandler.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaErrorHandler.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformer.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaValidationException.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaValidationException.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/StringGenerator.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/StringGenerator.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/TraxErrorListener.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/TraxErrorListener.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLConsumer.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLConsumer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLConsumerAdapter.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLConsumerAdapter.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLProducer.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLProducer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLSerializer.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLSerializer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTProcessorErrorListener.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTProcessorErrorListener.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTTransformer.java
      - copied, changed from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTTransformer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AbstractXMLPipe.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/AbstractXMLPipe.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AttributeTypes.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/AttributeTypes.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AttributesImpl.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/AttributesImpl.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/EmbeddedXMLPipe.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/EmbeddedXMLPipe.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/ImmutableAttributesImpl.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/ImmutableAttributesImpl.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/IncludeXMLConsumer.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/IncludeXMLConsumer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/NullXMLConsumer.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/NullXMLConsumer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/SaxBuffer.java   (props changed)
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/SaxBuffer.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/TransformationUtils.java
      - copied unchanged from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/TransformationUtils.java
    cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java   (contents, props changed)
      - copied, changed from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/sax/
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformerTest.java   (props changed)
      - copied unchanged from r734138, cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformerTest.java
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/util/
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/util/TransformationUtilsTest.java
      - copied, changed from r734138, cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/util/TransformationUtilsTest.java
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/
    cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java   (with props)
Removed:
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractGenerator.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractSerializer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractTransformer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractXMLProducer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/CleaningTransformer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/FileGenerator.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/IncludeTransformer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaErrorHandler.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaValidationException.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/StringGenerator.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/TraxErrorListener.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLConsumer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLConsumerAdapter.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLProducer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XMLSerializer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTProcessorErrorListener.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTTransformer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/AbstractXMLPipe.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/AttributeTypes.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/AttributesImpl.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/EmbeddedXMLPipe.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/ImmutableAttributesImpl.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/IncludeXMLConsumer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/NullXMLConsumer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/SaxBuffer.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/TransformationUtils.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/component/sax/
    cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/util/
    cocoon/cocoon3/trunk/cocoon-pipeline/src/test/resources/test.xsd
    cocoon/cocoon3/trunk/cocoon-pipeline/src/test/resources/test.xslt
Modified:
    cocoon/cocoon3/trunk/cocoon-optional/pom.xml
    cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/URLConnectionUtils.java
    cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/PipelineTest.java
    cocoon/cocoon3/trunk/cocoon-servlet/pom.xml
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceGenerator.java
    cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceTransformer.java
    cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml
    cocoon/cocoon3/trunk/cocoon-stax/pom.xml
    cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/StAXCleaningTransformer.java

Modified: cocoon/cocoon3/trunk/cocoon-optional/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-optional/pom.xml?rev=734167&r1=734166&r2=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-optional/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-optional/pom.xml Tue Jan 13 08:14:56 2009
@@ -44,6 +44,10 @@
       <groupId>org.apache.cocoon.pipeline</groupId>
       <artifactId>cocoon-pipeline</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon.sax</groupId>
+      <artifactId>cocoon-sax</artifactId>
+    </dependency>
     <!-- Other libraries -->
      <dependency>
       <groupId>commons-betwixt</groupId>

Modified: cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/URLConnectionUtils.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/URLConnectionUtils.java?rev=734167&r1=734166&r2=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/URLConnectionUtils.java (original)
+++ cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/URLConnectionUtils.java Tue Jan 13 08:14:56 2009
@@ -21,9 +21,6 @@
 import java.io.OutputStream;
 import java.net.URLConnection;
 
-import org.apache.cocoon.pipeline.PipelineException;
-import org.apache.cocoon.pipeline.ProcessingException;
-import org.apache.cocoon.pipeline.component.sax.XMLConsumer;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -32,26 +29,6 @@
     private static final Log LOG = LogFactory.getLog(URLConnectionUtils.class);
 
     /**
-     * Stream a {@link URLConnection} into an {@link XMLConsumer} by using
-     * {@link XMLUtils#toSax(InputStream, XMLConsumer)}. The {@link URLConnection} is closed after streaming.
-     * 
-     * @param The {@link URLConnection} to be streamed.
-     * @param An {@link XMLConsumer} as target.
-     */
-    public static void toSax(URLConnection urlConnection, XMLConsumer xmlConsumer) {
-        try {
-            InputStream inputStream = urlConnection.getInputStream();
-            XMLUtils.toSax(inputStream, xmlConsumer);
-        } catch (PipelineException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new ProcessingException("Can't parse url connection " + urlConnection.getURL(), e);
-        } finally {
-            closeQuietly(urlConnection);
-        }
-    }
-
-    /**
      * Close a {@link URLConnection} quietly and take care of all the exception handling.
      * 
      * @param The {@link URLConnection} to be closed.
@@ -91,4 +68,4 @@
             }
         }
     }
-}
\ No newline at end of file
+}

Modified: cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/PipelineTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/PipelineTest.java?rev=734167&r1=734166&r2=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/PipelineTest.java (original)
+++ cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/PipelineTest.java Tue Jan 13 08:14:56 2009
@@ -18,15 +18,9 @@
  */
 package org.apache.cocoon.pipeline;
 
-import java.io.ByteArrayOutputStream;
-
 import junit.framework.TestCase;
 
 import org.apache.cocoon.pipeline.component.sax.FileReaderComponent;
-import org.apache.cocoon.pipeline.component.sax.StringGenerator;
-import org.apache.cocoon.pipeline.component.sax.XMLSerializer;
-import org.apache.cocoon.pipeline.component.sax.XSLTTransformer;
-import org.custommonkey.xmlunit.Diff;
 
 public class PipelineTest extends TestCase {
 
@@ -39,21 +33,4 @@
         pipeline.setup(System.out);
         pipeline.execute();
     }
-
-    /**
-     * A pipeline that performs a simple transformation: generator -&gt; transformer -&gt; serializer
-     */
-    public void testPipelineWithTransformer() throws Exception {
-        Pipeline pipeline = new NonCachingPipeline();
-        pipeline.addComponent(new StringGenerator("<x></x>"));
-        pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("/test.xslt")));
-        pipeline.addComponent(new XMLSerializer());
-
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        pipeline.setup(baos);
-        pipeline.execute();
-
-        Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><p></p>", new String(baos.toByteArray()));
-        assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
-    }
 }

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractGenerator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractGenerator.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractGenerator.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/AbstractGenerator.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/FileGenerator.java (from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/FileGenerator.java)
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/FileGenerator.java?p2=cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/FileGenerator.java&p1=cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/FileGenerator.java&r1=734135&r2=734167&rev=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/FileGenerator.java (original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/FileGenerator.java Tue Jan 13 08:14:56 2009
@@ -29,6 +29,7 @@
 import org.apache.cocoon.pipeline.component.CachingPipelineComponent;
 import org.apache.cocoon.pipeline.util.StringRepresentation;
 import org.apache.cocoon.pipeline.util.URLConnectionUtils;
+import org.apache.cocoon.pipeline.util.XMLUtils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -76,7 +77,7 @@
         }
 
         try {
-            URLConnectionUtils.toSax(this.source.openConnection(), this.getXMLConsumer());
+            XMLUtils.toSax(this.source.openConnection(), this.getXMLConsumer());
         } catch (IOException e) {
             throw new ProcessingException("Can't open connection to " + this.source, e);
         }

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaErrorHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaErrorHandler.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaErrorHandler.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaErrorHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformer.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaValidationException.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaValidationException.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaValidationException.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/SchemaValidationException.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTTransformer.java (from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTTransformer.java)
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTTransformer.java?p2=cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTTransformer.java&p1=cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTTransformer.java&r1=734135&r2=734167&rev=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTTransformer.java (original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/component/sax/XSLTTransformer.java Tue Jan 13 08:14:56 2009
@@ -116,8 +116,7 @@
 
         // Create transformer handler
         final TransformerHandler handler = transformerFactory.newTransformerHandler(templatesHandler.getTemplates());
-        handler.getTransformer().setErrorListener(
-                new XSLTProcessorErrorListener(this.log, this.source.toExternalForm()));
+        handler.getTransformer().setErrorListener(new XSLTProcessorErrorListener(this.log, this.source.toExternalForm()));
 
         return handler;
     }

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AbstractXMLPipe.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AbstractXMLPipe.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AbstractXMLPipe.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AbstractXMLPipe.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AttributeTypes.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AttributeTypes.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AttributeTypes.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AttributeTypes.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AttributesImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AttributesImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AttributesImpl.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/AttributesImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/EmbeddedXMLPipe.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/EmbeddedXMLPipe.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/EmbeddedXMLPipe.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/EmbeddedXMLPipe.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/ImmutableAttributesImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/ImmutableAttributesImpl.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/ImmutableAttributesImpl.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/ImmutableAttributesImpl.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/IncludeXMLConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/IncludeXMLConsumer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/IncludeXMLConsumer.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/IncludeXMLConsumer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/NullXMLConsumer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/NullXMLConsumer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/NullXMLConsumer.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/NullXMLConsumer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/SaxBuffer.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/SaxBuffer.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/SaxBuffer.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/SaxBuffer.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java (from r734135, cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java)
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java?p2=cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java&p1=cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java&r1=734135&r2=734167&rev=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java (original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java Tue Jan 13 08:14:56 2009
@@ -22,6 +22,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.StringReader;
+import java.net.URLConnection;
 import java.util.Properties;
 
 import javax.xml.transform.TransformerFactory;
@@ -29,6 +30,7 @@
 import javax.xml.transform.sax.TransformerHandler;
 import javax.xml.transform.stream.StreamResult;
 
+import org.apache.cocoon.pipeline.PipelineException;
 import org.apache.cocoon.pipeline.ProcessingException;
 import org.apache.cocoon.pipeline.component.sax.XMLConsumer;
 import org.xml.sax.EntityResolver;
@@ -38,13 +40,11 @@
 import org.xml.sax.helpers.XMLReaderFactory;
 
 /**
- * Utilities for the usage of an {@link XMLReader} together with a
- * {@link XMLConsumer}.
+ * Utilities for the usage of an {@link XMLReader} together with a {@link XMLConsumer}.
  */
 public abstract class XMLUtils {
 
-    private static final SAXTransformerFactory SAX_TRANSFORMER_FACTORY = (SAXTransformerFactory) TransformerFactory
-            .newInstance();
+    private static final SAXTransformerFactory SAX_TRANSFORMER_FACTORY = (SAXTransformerFactory) TransformerFactory.newInstance();
 
     /**
      * Serialize the content of a {@link SaxBuffer} into an {@link OutputStream}.
@@ -69,22 +69,19 @@
     }
 
     /**
-     * Use a SAX parser and read the content of an {@link InputStream} into an
-     * {@link XMLConsumer}.
+     * Use a SAX parser and read the content of an {@link InputStream} into an {@link XMLConsumer}.
      * 
      * @param inputStream InputStream containing the content to be parsed.
      * @param xmlConsumer The XMLConsumer to use.
      * @throws IOException if the {@link InputStream} can't be used.
      * @throws SAXException if the {@link InputStream} can't be parsed.
      */
-    public static void toSax(final InputStream inputStream, final XMLConsumer xmlConsumer) throws IOException,
-            SAXException {
+    public static void toSax(final InputStream inputStream, final XMLConsumer xmlConsumer) throws IOException, SAXException {
         createXMLReader(xmlConsumer).parse(new InputSource(new BufferedInputStream(inputStream)));
     }
 
     /**
-     * Use a SAX parser and read the content of an {@link InputStream} into an
-     * {@link XMLConsumer}.
+     * Use a SAX parser and read the content of an {@link InputStream} into an {@link XMLConsumer}.
      * 
      * @param string A String to be parsed.
      * @param xmlConsumer The XMLConsumer to use.
@@ -95,6 +92,27 @@
         createXMLReader(xmlConsumer).parse(new InputSource(new StringReader(string)));
     }
 
+    /**
+     * Stream a {@link URLConnection} into an {@link XMLConsumer} by using
+     * {@link XMLUtils#toSax(InputStream, XMLConsumer)}. The {@link URLConnection} is closed after
+     * streaming.
+     * 
+     * @param The {@link URLConnection} to be streamed.
+     * @param An {@link XMLConsumer} as target.
+     */
+    public static void toSax(URLConnection urlConnection, XMLConsumer xmlConsumer) {
+        try {
+            InputStream inputStream = urlConnection.getInputStream();
+            XMLUtils.toSax(inputStream, xmlConsumer);
+        } catch (PipelineException e) {
+            throw e;
+        } catch (Exception e) {
+            throw new ProcessingException("Can't parse url connection " + urlConnection.getURL(), e);
+        } finally {
+            URLConnectionUtils.closeQuietly(urlConnection);
+        }
+    }
+
     private static XMLReader createXMLReader(final XMLConsumer xmlConsumer) {
         XMLReader xmlReader;
         try {
@@ -102,6 +120,7 @@
             xmlReader.setContentHandler(xmlConsumer);
             xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", xmlConsumer);
             xmlReader.setEntityResolver(new EntityResolver() {
+
                 public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
                     return new InputSource(new ByteArrayInputStream(new String("").getBytes()));
                 }
@@ -112,4 +131,4 @@
 
         return xmlReader;
     }
-}
\ No newline at end of file
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/pipeline/util/XMLUtils.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformerTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformerTest.java
------------------------------------------------------------------------------
    svn:mergeinfo = 

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/component/sax/SchemaProcessorTransformerTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Copied: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/util/TransformationUtilsTest.java (from r734138, cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/util/TransformationUtilsTest.java)
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/util/TransformationUtilsTest.java?p2=cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/util/TransformationUtilsTest.java&p1=cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/util/TransformationUtilsTest.java&r1=734138&r2=734167&rev=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-pipeline/src/test/java/org/apache/cocoon/pipeline/util/TransformationUtilsTest.java (original)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/pipeline/util/TransformationUtilsTest.java Tue Jan 13 08:14:56 2009
@@ -22,15 +22,12 @@
 
 import junit.framework.TestCase;
 
-import org.apache.cocoon.pipeline.PipelineTest;
-import org.apache.cocoon.pipeline.util.TransformationUtils;
 import org.custommonkey.xmlunit.Diff;
 
 public class TransformationUtilsTest extends TestCase {
 
     public void testStringTransformation() throws Exception {
-        String result = TransformationUtils.transform("<x>test</x>", PipelineTest.class.getClassLoader().getResource(
-                "test.xslt"));
+        String result = TransformationUtils.transform("<x>test</x>", this.getClass().getClassLoader().getResource("test.xslt"));
         Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><p></p>", result);
         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
     }
@@ -38,8 +35,8 @@
     public void testStringTransformationWithParameter() throws Exception {
         Map<String, Object> params = new HashMap<String, Object>();
         params.put("myParam", "abc");
-        String result = TransformationUtils.transform("<x>test</x>", params, PipelineTest.class.getClassLoader()
-                .getResource("test.xslt"));
+        String result = TransformationUtils
+                .transform("<x>test</x>", params, this.getClass().getClassLoader().getResource("test.xslt"));
         Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><p>abc</p>", result);
         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
         assertTrue(result.startsWith("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"));
@@ -48,8 +45,7 @@
     public void testStringTransformationWithProperties() throws Exception {
         Properties props = new Properties();
         props.put("encoding", "iso-8859-1");
-        String result = TransformationUtils.transform("<x>test</x>", props, PipelineTest.class.getClassLoader()
-                .getResource("test.xslt"));
+        String result = TransformationUtils.transform("<x>test</x>", props, this.getClass().getClassLoader().getResource("test.xslt"));
         Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?><p/>", result);
         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
         assertTrue(result.startsWith("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>"));
@@ -60,8 +56,8 @@
         props.put("encoding", "iso-8859-1");
         Map<String, Object> params = new HashMap<String, Object>();
         params.put("myParam", "abc");
-        String result = TransformationUtils.transform("<x>test</x>", params, props, PipelineTest.class
-                .getClassLoader().getResource("test.xslt"));
+        String result = TransformationUtils.transform("<x>test</x>", params, props, this.getClass().getClassLoader().getResource(
+                "test.xslt"));
         Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?><p>abc</p>", result);
         assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
     }

Added: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java?rev=734167&view=auto
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java (added)
+++ cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java Tue Jan 13 08:14:56 2009
@@ -0,0 +1,51 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cocoon.sax;
+
+import java.io.ByteArrayOutputStream;
+
+import junit.framework.TestCase;
+
+import org.apache.cocoon.pipeline.NonCachingPipeline;
+import org.apache.cocoon.pipeline.Pipeline;
+import org.apache.cocoon.pipeline.component.sax.StringGenerator;
+import org.apache.cocoon.pipeline.component.sax.XMLSerializer;
+import org.apache.cocoon.pipeline.component.sax.XSLTTransformer;
+import org.custommonkey.xmlunit.Diff;
+
+public class PipelineTest extends TestCase {
+
+    /**
+     * A pipeline that performs a simple transformation: generator -&gt; transformer -&gt;
+     * serializer
+     */
+    public void testPipelineWithTransformer() throws Exception {
+        Pipeline pipeline = new NonCachingPipeline();
+        pipeline.addComponent(new StringGenerator("<x></x>"));
+        pipeline.addComponent(new XSLTTransformer(this.getClass().getResource("/test.xslt")));
+        pipeline.addComponent(new XMLSerializer());
+
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        pipeline.setup(baos);
+        pipeline.execute();
+
+        Diff diff = new Diff("<?xml version=\"1.0\" encoding=\"UTF-8\"?><p></p>", new String(baos.toByteArray()));
+        assertTrue("XSL transformation didn't work as expected " + diff, diff.identical());
+    }
+}

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/cocoon3/trunk/cocoon-sax/src/test/java/org/apache/cocoon/sax/PipelineTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/cocoon3/trunk/cocoon-servlet/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/pom.xml?rev=734167&r1=734166&r2=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/pom.xml Tue Jan 13 08:14:56 2009
@@ -46,6 +46,10 @@
       <groupId>org.apache.cocoon.controller</groupId>
       <artifactId>cocoon-controller</artifactId>
     </dependency>
+    <dependency>
+      <groupId>org.apache.cocoon.sax</groupId>
+      <artifactId>cocoon-sax</artifactId>
+    </dependency>
 
     <!-- Cocoon subprojects -->
     <dependency>

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceGenerator.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceGenerator.java?rev=734167&r1=734166&r2=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceGenerator.java (original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceGenerator.java Tue Jan 13 08:14:56 2009
@@ -22,7 +22,7 @@
 import org.apache.cocoon.pipeline.ProcessingException;
 import org.apache.cocoon.pipeline.component.Starter;
 import org.apache.cocoon.pipeline.component.sax.AbstractXMLProducer;
-import org.apache.cocoon.pipeline.util.URLConnectionUtils;
+import org.apache.cocoon.pipeline.util.XMLUtils;
 
 public class ServletServiceGenerator extends AbstractXMLProducer implements Starter {
 
@@ -34,7 +34,7 @@
         }
 
         try {
-            URLConnectionUtils.toSax(this.service.openConnection(), this.getXMLConsumer());
+            XMLUtils.toSax(this.service.openConnection(), this.getXMLConsumer());
         } catch (Exception e) {
             throw new ProcessingException("Can't parse " + this.service, e);
         }
@@ -44,4 +44,4 @@
     public void setConfiguration(Map<String, ? extends Object> configuration) {
         this.service = (URL) configuration.get("service");
     }
-}
\ No newline at end of file
+}

Modified: cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceTransformer.java?rev=734167&r1=734166&r2=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceTransformer.java (original)
+++ cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/ssf/ServletServiceTransformer.java Tue Jan 13 08:14:56 2009
@@ -25,7 +25,6 @@
 import org.apache.cocoon.pipeline.ProcessingException;
 import org.apache.cocoon.pipeline.component.sax.AbstractTransformer;
 import org.apache.cocoon.pipeline.util.SaxBuffer;
-import org.apache.cocoon.pipeline.util.URLConnectionUtils;
 import org.apache.cocoon.pipeline.util.XMLUtils;
 import org.xml.sax.SAXException;
 
@@ -51,7 +50,7 @@
 
         try {
             XMLUtils.toOutputStream(this.getUrlConnection().getOutputStream(), saxBuffer);
-            URLConnectionUtils.toSax(this.getUrlConnection(), this.getXMLConsumer());
+            XMLUtils.toSax(this.getUrlConnection(), this.getXMLConsumer());
         } catch (IOException e) {
             throw new ProcessingException("Can't stream SaxBuffer into the output stream of the URL "
                     + this.getUrlConnection().getURL());
@@ -78,4 +77,4 @@
             throw new ProcessingException(("Can't create an URL for " + configuration.get("service") + "."), e);
         }
     }
-}
\ No newline at end of file
+}

Modified: cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml?rev=734167&r1=734166&r2=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-sitemap/pom.xml Tue Jan 13 08:14:56 2009
@@ -42,6 +42,10 @@
       <artifactId>cocoon-pipeline</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.apache.cocoon.sax</groupId>
+      <artifactId>cocoon-sax</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context</artifactId>
     </dependency>

Modified: cocoon/cocoon3/trunk/cocoon-stax/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stax/pom.xml?rev=734167&r1=734166&r2=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stax/pom.xml (original)
+++ cocoon/cocoon3/trunk/cocoon-stax/pom.xml Tue Jan 13 08:14:56 2009
@@ -52,6 +52,12 @@
       </exclusions>
     </dependency>
 
+    <!-- test dependencies -->
+    <dependency>
+      <groupId>org.apache.cocoon.sax</groupId>
+      <artifactId>cocoon-sax</artifactId>
+      <scope>test</scope>
+    </dependency>
     <dependency>
       <groupId>commons-io</groupId>
       <artifactId>commons-io</artifactId>

Modified: cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/StAXCleaningTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/StAXCleaningTransformer.java?rev=734167&r1=734166&r2=734167&view=diff
==============================================================================
--- cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/StAXCleaningTransformer.java (original)
+++ cocoon/cocoon3/trunk/cocoon-stax/src/main/java/org/apache/cocoon/stax/StAXCleaningTransformer.java Tue Jan 13 08:14:56 2009
@@ -21,12 +21,9 @@
 import javax.xml.stream.events.StartElement;
 import javax.xml.stream.events.XMLEvent;
 
-import org.apache.cocoon.pipeline.component.sax.CleaningTransformer;
-
 /**
- * Transformer which is used to clean an xml document from all whitespaces,
- * comments and namespace start prefixes and end prefixes as its SAX counterpart
- * the {@link CleaningTransformer}.
+ * Transformer which is used to clean an xml document from all whitespaces, comments and namespace
+ * start prefixes and end prefixes as its SAX counterpart the {@link CleaningTransformer}.
  */
 public class StAXCleaningTransformer extends AbstractStAXTransformer {
 
@@ -58,8 +55,8 @@
             } else if (event.isStartElement()) {
                 // handle namespaces
                 StartElement startElement = event.asStartElement();
-                return eventFactory.createStartElement("", startElement.getNamespaceURI(""), startElement.getName()
-                        .getLocalPart(), startElement.getAttributes(), null, startElement.getNamespaceContext());
+                return eventFactory.createStartElement("", startElement.getNamespaceURI(""), startElement.getName().getLocalPart(),
+                        startElement.getAttributes(), null, startElement.getNamespaceContext());
             }
 
             return event;



Mime
View raw message