cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simonetrip...@apache.org
Subject svn commit: r898101 [2/4] - in /cocoon/site/site/3.0: ./ reference/ reference/html-single/ reference/html/ reference/pdf/ student-project-ideas/
Date Mon, 11 Jan 2010 22:47:03 GMT
Modified: cocoon/site/site/3.0/reference/html-single/pipelines.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/3.0/reference/html-single/pipelines.html?rev=898101&r1=898100&r2=898101&view=diff
==============================================================================
--- cocoon/site/site/3.0/reference/html-single/pipelines.html (original)
+++ cocoon/site/site/3.0/reference/html-single/pipelines.html Mon Jan 11 22:47:02 2010
@@ -39,7 +39,7 @@
       </p><p>
         Here is some Java code that demonstrates how a pipeline can be utilized with SAX-based XML components:      
       </p><div class="programlistingco"><pre class="programlisting">Pipeline&lt;SAXPipelineComponent&gt; pipeline = <span class="hl-keyword">new</span> NonCachingPipeline&lt;SAXPipelineComponent&gt;();<span class="co"><img src="images/callouts/1.png" alt="(1)"></span>
-pipeline.addComponent(<span class="hl-keyword">new</span> StringGenerator(<span class="hl-string">"&lt;x&gt;&lt;/x&gt;"</span>));                                   <span class="co"><img src="images/callouts/2.png" alt="(2)"></span>
+pipeline.addComponent(<span class="hl-keyword">new</span> XMLGenerator(<span class="hl-string">"&lt;x&gt;&lt;/x&gt;"</span>));                                      <span class="co"><img src="images/callouts/2.png" alt="(2)"></span>
 pipeline.addComponent(<span class="hl-keyword">new</span> XSLTTransformer(<span class="hl-keyword">this</span>.getClass().getResource(<span class="hl-string">"/test1.xslt"</span>)));  <span class="co"><img src="images/callouts/3.png" alt="(3)"></span>
 pipeline.addComponent(<span class="hl-keyword">new</span> XSLTTransformer(<span class="hl-keyword">this</span>.getClass().getResource(<span class="hl-string">"/test2.xslt"</span>)));  <span class="co"><img src="images/callouts/4.png" alt="(4)"></span>
 pipeline.addComponent(<span class="hl-keyword">new</span> XMLSerializer());                                              <span class="co"><img src="images/callouts/5.png" alt="(5)"></span>
@@ -54,14 +54,14 @@
               Add a generator, that implements the <code class="literal">org.apache.cocoon.pipeline.component.PipelineComponent</code> interface to the
               pipeline by using the pipeline's <code class="literal">addComponent(pipelineComponent)</code> interface.
             </p><p>
-              The <code class="literal">StringGenerator</code> expects a <code class="literal">java.lang.String</code> object and produces SAX events by using a SAX parser.
+              The <code class="literal">XMLGenerator</code> expects a <code class="literal">java.lang.String</code> object and produces SAX events by using a SAX parser.
               Hence it has to implement the <code class="literal">org.apache.cocoon.sax.component.SAXProducer</code> interface.
             </p><p>
               The <code class="literal">SAXProducer</code> interface extends the <code class="literal">org.apache.cocoon.pipeline.component.Producer</code> interface. This
               means that it expects the next (or the same!) component to implement the <code class="literal">org.apache.cocoon.pipeline.component.Consumer</code>
               interface. The check that the next pipeline component is of type <code class="literal">org.apache.cocoon.sax.component.SAXConsumer</code>
               isn't done at interface level but by the implementation (see the <code class="literal">org.apache.cocoon.sax.component.AbstractXMLProducer</code>
-              for details which the <code class="literal">StringGenerator</code> is inherited from).
+              for details which the <code class="literal">XMLGenerator</code> is inherited from).
             </p><p>
               Since a generator is the first component of a pipeline, it also has to implement the <code class="literal">Starter</code> interface.
             </p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/3.png" alt="3" border="0"></td><td valign="top" align="left"><p>
@@ -73,11 +73,11 @@
             </p><p>
               Since it implements the <code class="literal">org.apache.cocoon.pipeline.component.Consumer</code> interface, it fulfills the general contract that a <code class="literal">Consumer</code>
               is linked with a <code class="literal">Producer</code>. By implementing the <code class="literal">org.apache.cocoon.sax.component.SAXConsumer</code> interface,
-              it fulfills the specific requirement of the previous <code class="literal">StringGenerator</code> that expects a next pipeline component of that type. 
+              it fulfills the specific requirement of the previous <code class="literal">XMLGenerator</code> that expects a next pipeline component of that type. 
             </p><p>
               This transformer also implements the <code class="literal">org.apache.cocoon.sax.component.SAXProducer</code> interface. This interface extends the
               <code class="literal">org.apache.cocoon.pipeline.component.Producer</code> interface which means that the next component has to be a 
-              <code class="literal">org.apache.cocoon.pipeline.component.Consumer</code>. Like the previous <code class="literal">StringGenerator</code>, the <code class="literal">XSLTTransformer</code>
+              <code class="literal">org.apache.cocoon.pipeline.component.Consumer</code>. Like the previous <code class="literal">XMLGenerator</code>, the <code class="literal">XSLTTransformer</code>
               inherits from the <code class="literal">org.apache.cocoon.sax.component.AbstractXMLProducer</code> which contains the check that the next component
               is of type <code class="literal">org.apache.cocoon.sax.component.SAXConsumer</code>. 
             </p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/4.png" alt="4" border="0"></td><td valign="top" align="left"><p>
@@ -107,8 +107,8 @@
         </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e376"></a>2.4.2.2.&nbsp;SAX transformer</h4></div></div></div><p>explain from a user's point of view, what she needs to do to implement one</p><p>buffering</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e383"></a>2.4.2.3.&nbsp;SAX serializer</h4></div></div></div><p>explain from a user's point of view, what she needs to do to implement one</p></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="pipeline.stax"></a>2.5.&nbsp;StAX components</h2></div></div></div><p>StAX pipelines provide an alternative API for writing pipeline components. Altough they are not as fast as SAX, they provide easier state handling as the component can control when to pull the next events. This allows an implicit state rather than have to manage the state in the
  various content handler methods of SAX.</p><p>The most visible difference of StAX components in contrast to SAX is that the component itself has controls the parsing of the input whereas in SAX the parser controls the pipeline by calling the component.
     Our implementation of StAX pipelines uses just StAX interfaces for retrieving events - the writing interface is proprietary in order to avoid multihreading or continuations.
     So it is really a hybrid process - the StAX component is called to generate the next events, but it is also allowed to read as much data from the previous pipeline component as it wants. But as the produced events are kept in-memory until a later component pulls for them, the components should not emit large amounts of events during one invocation.
-    </p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e395"></a>2.5.1.&nbsp;Available components</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><code class="literal">StAXGenerator</code> is a Starter and normally parses a XML from an InputStream.</li><li><code class="literal">StAXSerializer</code> is a Finisher and writes the StAX Events to an OutputStream.</li><li><code class="literal">AbstractStAXTransformer</code> is the abstract base class for new transformers. It simplifies the task by providing a template method for generating the new events.</li><li><code class="literal">StAXCleaningTransformer</code> is an transformer, which cleans the document from whitespaces and comments.</li><li><code class="literal">IncludeTransformer</code> includes the contents of another document.</li></ul></div><p>For further information refer to the <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://cocoon.apache.or
 g/3.0/apidocs/org/apache/cocoon/stax/package-summary.html" target="_top">javadoc</a></p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e424"></a>2.5.2.&nbsp;Writing custom components</h3></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e427"></a>2.5.2.1.&nbsp;StAX generator</h4></div></div></div><p>The <code class="literal">StAXGenerator</code> is a <code class="literal">Starter</code> component and produces XMLEvents.
-  </p><div class="programlistingco"><pre class="programlisting"><span class="hl-keyword">import</span> java.io.InputStream;
+    </p><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e395"></a>2.5.1.&nbsp;Available components</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><p><code class="literal">StAXGenerator</code> is a Starter and normally parses a XML from an InputStream.</p></li><li><p><code class="literal">StAXSerializer</code> is a Finisher and writes the StAX Events to an OutputStream.</p></li><li><p><code class="literal">AbstractStAXTransformer</code> is the abstract base class for new transformers. It simplifies the task by providing a template method for generating the new events.</p></li><li><p><code class="literal">StAXCleaningTransformer</code> is an transformer, which cleans the document from whitespaces and comments.</p></li><li><p><code class="literal">IncludeTransformer</code> includes the contents of another document.</p></li></ul></div><p>For further information refer to the <a xmlns:xlink="http://www.w3.org/1999/x
 link" href="http://cocoon.apache.org/3.0/apidocs/org/apache/cocoon/stax/package-summary.html" target="_top">javadoc</a></p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e429"></a>2.5.2.&nbsp;Writing custom components</h3></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e432"></a>2.5.2.1.&nbsp;StAX generator</h4></div></div></div><p>The <code class="literal">StAXGenerator</code> is a <code class="literal">Starter</code> component and produces XMLEvents.
+	</p><div class="programlistingco"><pre class="programlisting"><span class="hl-keyword">import</span> java.io.InputStream;
 <span class="hl-keyword">import</span> java.net.URL;
 
 <span class="hl-keyword">import</span> javax.xml.stream.FactoryConfigurationError;
@@ -148,20 +148,20 @@
    <span class="hl-keyword">public</span> XMLEvent peek() <span class="hl-keyword">throws</span> XMLStreamException {
       <span class="hl-keyword">return</span> <span class="hl-keyword">this</span>.reader.peek();                                                         <span class="co"><img src="images/callouts/6.png" alt="(6)"></span>
    }
-  
-} </pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>
-        In order to implement an own <code class="literal">StAXGenerator</code> the easiest approach is to inherit from <code class="literal">AbstractStAXProducer</code>.
+	
+}	</pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>
+	      In order to implement an own <code class="literal">StAXGenerator</code> the easiest approach is to inherit from <code class="literal">AbstractStAXProducer</code>.
             </p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/2.png" alt="2" border="0"></td><td valign="top" align="left"><p>
-        The constructor creates a new XMLEventReader for reading from the inputstream.
+	      The constructor creates a new XMLEventReader for reading from the inputstream.
             </p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/3.png" alt="3" border="0"></td><td valign="top" align="left"><p>
-        The pipeline is started using the <code class="literal">execute</code> method. As StAX is a pull based approach the last component has to start pulling.
+	      The pipeline is started using the <code class="literal">execute</code> method. As StAX is a pull based approach the last component has to start pulling.
             </p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/4.png" alt="4" border="0"></td><td valign="top" align="left"><p>This method should return true if the generator has a next Event. </p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/5.png" alt="5" border="0"></td><td valign="top" align="left"><p>Returns the next event from the generator.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/6.png" alt="6" border="0"></td><td valign="top" align="left"><p>Returns the next event from the generator, without moving actually to the next event.</p></td></tr></table></div></div><p>
-  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e477"></a>2.5.2.2.&nbsp;StAX transformer</h4></div></div></div><p>Implementing a StAX Transformer should be the most common use case. The <code class="literal">AbstractStAXTransformer</code> provides a foundation for new transformers. But in order to write new transformers even simpler, let's describe another feature first:</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="d0e485"></a>2.5.2.2.1.&nbsp;Navigator</h5></div></div></div><p>Navigators allow an easier navigation in the XML document. They also simplify transformers, as usually transformers need only process some parts of the input document and the navigator helps to identify the interesting parts. There are several implementations already included:
-  </p><div class="itemizedlist"><ul type="disc"><li><code class="literal">FindStartElementNavigator</code> finds the start tag with certain properties(name,attribute)</li><li><code class="literal">FindEndElementNavigator</code> finds the end tag with certain properties(name,attribute)</li><li><code class="literal">FindCorrespondingStartEndElementPairNavigator</code> finds both the start and the corresponding end tag.</li><li><code class="literal">InSubtreeNavigator</code> finds whole subtrees, by specifying the properties of the "root" element.</li></ul></div><p>
-  For further information refer to the <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://cocoon.apache.org/3.0/apidocs/org/apache/cocoon/stax/navigation/package-summary.html" target="_top">navigator javadoc</a>
-  </p><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="d0e511"></a>2.5.2.2.1.1.&nbsp;Using navigators</h6></div></div></div><p>
-    Using a navigator is a rather simple task. The transformer peeks or gets the next event and calls <code class="literal">Navigator.fulfillsCriteria</code> - if true is returned the transformer should be process that event somehow. 
-    </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="d0e519"></a>2.5.2.2.1.2.&nbsp;Implementing a navigator</h6></div></div></div><p>Creating a new navigator is a rather simple task and just means implementing two methods:</p><div class="programlistingco"><pre class="programlisting"><span class="hl-keyword">import</span> javax.xml.stream.events.XMLEvent;
+	</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e482"></a>2.5.2.2.&nbsp;StAX transformer</h4></div></div></div><p>Implementing a StAX Transformer should be the most common use case. The <code class="literal">AbstractStAXTransformer</code> provides a foundation for new transformers. But in order to write new transformers even simpler, let's describe another feature first:</p><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="d0e490"></a>2.5.2.2.1.&nbsp;Navigator</h5></div></div></div><p>Navigators allow an easier navigation in the XML document. They also simplify transformers, as usually transformers need only process some parts of the input document and the navigator helps to identify the interesting parts. There are several implementations already included:
+	</p><div class="itemizedlist"><ul type="disc"><li><p><code class="literal">FindStartElementNavigator</code> finds the start tag with certain properties(name,attribute)</p></li><li><p><code class="literal">FindEndElementNavigator</code> finds the end tag with certain properties(name,attribute)</p></li><li><p><code class="literal">FindCorrespondingStartEndElementPairNavigator</code> finds both the start and the corresponding end tag.</p></li><li><p><code class="literal">InSubtreeNavigator</code> finds whole subtrees, by specifying the properties of the "root" element.</p></li></ul></div><p>
+	For further information refer to the <a xmlns:xlink="http://www.w3.org/1999/xlink" href="http://cocoon.apache.org/3.0/apidocs/org/apache/cocoon/stax/navigation/package-summary.html" target="_top">navigator javadoc</a>
+	</p><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="d0e520"></a>2.5.2.2.1.1.&nbsp;Using navigators</h6></div></div></div><p>
+	  Using a navigator is a rather simple task. The transformer peeks or gets the next event and calls <code class="literal">Navigator.fulfillsCriteria</code> - if true is returned the transformer should be process that event somehow. 
+	  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h6 class="title"><a name="d0e528"></a>2.5.2.2.1.2.&nbsp;Implementing a navigator</h6></div></div></div><p>Creating a new navigator is a rather simple task and just means implementing two methods:</p><div class="programlistingco"><pre class="programlisting"><span class="hl-keyword">import</span> javax.xml.stream.events.XMLEvent;
 
 <span class="hl-keyword">public</span> <span class="hl-keyword">class</span> MyNavigator <span class="hl-keyword">implements</span> Navigator {
    <span class="hl-keyword">public</span> <span class="hl-keyword">boolean</span> fulfillsCriteria(XMLEvent event) {                                     <span class="co"><img src="images/callouts/1.png" alt="(1)"></span>
@@ -172,11 +172,11 @@
       <span class="hl-keyword">return</span> false;
    }
 }
-  </pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>
-        This method returns true if the event matches the criteria of the navigator.
+	</pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>
+	      This method returns true if the event matches the criteria of the navigator.
             </p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/2.png" alt="2" border="0"></td><td valign="top" align="left"><p>
-        Returns the result of the last invocation of fulfillsCriteria.
-      </p></td></tr></table></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="d0e537"></a>2.5.2.2.2.&nbsp;Implementing a transformer</h5></div></div></div><p>The next example should show you an transformer featuring navigators and implicit state handling through function calls.</p><div class="programlistingco"><pre class="programlisting"><span class="hl-keyword">public</span> <span class="hl-keyword">class</span> DaisyLinkRewriteTransformer <span class="hl-keyword">extends</span> AbstractStAXTransformer {
+	      Returns the result of the last invocation of fulfillsCriteria.
+	    </p></td></tr></table></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h5 class="title"><a name="d0e546"></a>2.5.2.2.2.&nbsp;Implementing a transformer</h5></div></div></div><p>The next example should show you an transformer featuring navigators and implicit state handling through function calls.</p><div class="programlistingco"><pre class="programlisting"><span class="hl-keyword">public</span> <span class="hl-keyword">class</span> DaisyLinkRewriteTransformer <span class="hl-keyword">extends</span> AbstractStAXTransformer {
   @Override
    <span class="hl-keyword">protected</span> <span class="hl-keyword">void</span> produceEvents() <span class="hl-keyword">throws</span> XMLStreamException {
       <span class="hl-keyword">while</span> (<span class="hl-keyword">this</span>.getParent().hasNext()) {
@@ -228,7 +228,9 @@
 
    <span class="hl-keyword">private</span> <span class="hl-keyword">void</span> rewriteAttributesAndEmitEvent(StartElement event, LinkInfo linkInfo) ;
 
-}</pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>The transformer checks for anchors in the XML.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/2.png" alt="2" border="0"></td><td valign="top" align="left"><p>If an anchor is found, it invokes a method which parses the link info if there is any. The additional array is for returning any events, which were read but do not belong to the linkinfo.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/3.png" alt="3" border="0"></td><td valign="top" align="left"><p>This method finally writes the start tag with the correct attributes taken from the parsed LinkInfo.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/4.png" alt="4" border="0"></td><td valign="top" align="left"><p>T
 he events, which were read but not parsed, are finally added to the output of the transformer.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/5.png" alt="5" border="0"></td><td valign="top" align="left"><p>The parser for the linkInfo object uses itself also navigators ...</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/6.png" alt="6" border="0"></td><td valign="top" align="left"><p>... and reads more events from the parent.</p></td></tr></table></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e571"></a>2.5.2.3.&nbsp;StAX serializer</h4></div></div></div><p>The <code class="literal">StAXSerializer</code> pulls and serializes the StAX events from the pipeline.</p><div class="programlistingco"><pre class="programlisting"><span class="hl-keyword">public</span> <span class="hl-keyword">class</span> NullSerializer <span class="hl-keyword">ext
 ends</span> AbstractStAXPipelineComponent <span class="hl-keyword">implements</span> StAXConsumer, Finisher {
+}</pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>The transformer checks for anchors in the XML.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/2.png" alt="2" border="0"></td><td valign="top" align="left"><p>If an anchor is found, it invokes a method which parses the link info if there is any. The additional array is for returning any events, which were read but do not belong to the linkinfo.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/3.png" alt="3" border="0"></td><td valign="top" align="left"><p>This method finally writes the start tag with the correct attributes taken from the parsed LinkInfo.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/4.png" alt="4" border="0"></td><td valign="top" align="left"><p>T
 he events, which were read but not parsed, are finally added to the output of the transformer.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/5.png" alt="5" border="0"></td><td valign="top" align="left"><p>The parser for the linkInfo object uses itself also navigators ...</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/6.png" alt="6" border="0"></td><td valign="top" align="left"><p>... and reads more events from the parent.</p></td></tr></table></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e580"></a>2.5.2.3.&nbsp;StAX serializer</h4></div></div></div><p>The <code class="literal">StAXSerializer</code> pulls and serializes the StAX events from the pipeline.</p><div class="programlistingco"><pre class="programlisting"><span class="hl-keyword">public</span> <span class="hl-keyword">class</span> NullSerializer <span class="hl-keyword">ext
 ends</span> AbstractStAXPipelineComponent 
+   <span class="hl-keyword">implements</span> StAXConsumer, Finisher {
+   
    <span class="hl-keyword">private</span> StAXProducer parent;                                                          <span class="co"><img src="images/callouts/1.png" alt="(1)"></span>
 
    <span class="hl-keyword">public</span> <span class="hl-keyword">void</span> initiatePullProcessing() {                                                <span class="co"><img src="images/callouts/2.png" alt="(2)"></span>
@@ -248,19 +250,19 @@
 
    <span class="hl-keyword">public</span> String getContentType()  ;                                                     <span class="co"><img src="images/callouts/5.png" alt="(5)"></span>
    <span class="hl-keyword">public</span> <span class="hl-keyword">void</span> setOutputStream(OutputStream outputStream) ;
-}</pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>The Finisher has to pull from the previous pipeline component..</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/2.png" alt="2" border="0"></td><td valign="top" align="left"><p>In case of StAX the last pipeline component has to start pulling for Events.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/3.png" alt="3" border="0"></td><td valign="top" align="left"><p>The serializer pulls the next Event from the previous component and should as next step serialize it.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/4.png" alt="4" border="0"></td><td valign="top" align="left"><p>During the pipeline construction the setParent is called to set the previous component of the 
 pipeline.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/5.png" alt="5" border="0"></td><td valign="top" align="left"><p>These two methods are defined in the Finisher and allow to set the OutputStream (if the Serializer needs any) and to retrieve the content-type of the result..</p></td></tr></table></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e604"></a>2.5.3.&nbsp;Using StAX and SAX components in the same pipeline</h3></div></div></div><p>The StAX pipeline offers interoperability to SAX components to a certain degree. However due their different paradigms only two use cases are currently implemented: Wrapping a SAX component in a StAX pipeline and a StAX-to-SAX pipeline, which starts with StAX components and finishes with SAX.</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e609"></a>2.5.3.1.&nbsp;Wrapping a SAX compone
 nt in a StAX pipeline</h4></div></div></div><p>This allows to use existing SAX components in a StAX pipeline. Beware the overhead of the conversion of StAX-&gt;SAX-&gt;StAX - so no performance gains from a SAX component can be expected.</p><div class="programlistingco"><pre class="programlisting">
+}</pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>The Finisher has to pull from the previous pipeline component..</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/2.png" alt="2" border="0"></td><td valign="top" align="left"><p>In case of StAX the last pipeline component has to start pulling for Events.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/3.png" alt="3" border="0"></td><td valign="top" align="left"><p>The serializer pulls the next Event from the previous component and should as next step serialize it.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/4.png" alt="4" border="0"></td><td valign="top" align="left"><p>During the pipeline construction the setParent is called to set the previous component of the 
 pipeline.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/5.png" alt="5" border="0"></td><td valign="top" align="left"><p>These two methods are defined in the Finisher and allow to set the OutputStream (if the Serializer needs any) and to retrieve the content-type of the result..</p></td></tr></table></div></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e613"></a>2.5.3.&nbsp;Using StAX and SAX components in the same pipeline</h3></div></div></div><p>The StAX pipeline offers interoperability to SAX components to a certain degree. However due their different paradigms only two use cases are currently implemented: Wrapping a SAX component in a StAX pipeline and a StAX-to-SAX pipeline, which starts with StAX components and finishes with SAX.</p><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e618"></a>2.5.3.1.&nbsp;Wrapping a SAX compone
 nt in a StAX pipeline</h4></div></div></div><p>This allows to use existing SAX components in a StAX pipeline. Beware the overhead of the conversion of StAX-&gt;SAX-&gt;StAX - so no performance gains from a SAX component can be expected.</p><div class="programlistingco"><pre class="programlisting">
 Pipeline&lt;StAXPipelineComponent&gt; pipeStAX = <span class="hl-keyword">new</span> NonCachingPipeline&lt;StAXPipelineComponent&gt;(<span class="co"><img src="images/callouts/1.png" alt="(1)"></span>);
 pipeStAX.addComponent(<span class="hl-keyword">new</span> StAXGenerator(input));                                         <span class="co"><img src="images/callouts/2.png" alt="(2)"></span>
 pipeStAX.addComponent(<span class="hl-keyword">new</span> SAXForStAXPipelineWrapper(<span class="hl-keyword">new</span> CleaningTransformer()));         <span class="co"><img src="images/callouts/3.png" alt="(3)"></span>
 pipeStAX.addComponent(<span class="hl-keyword">new</span> StAXSerializer());
 pipeStAX.setup(System.out);
-pipeStAX.execute();</pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>The pipeline uses a <code class="literal">StAXGenerator</code> - which produces StAX events.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/2.png" alt="2" border="0"></td><td valign="top" align="left"><p>In order to embed a single SAX component in a StAX pipeline, the <code class="literal">SAXForStAXPipelineWrapper</code> is needed. The constructor argument is the SAX component.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/3.png" alt="3" border="0"></td><td valign="top" align="left"><p>Altough the <code class="literal">CleaningTransformer</code> would emit SAX calls - the wrapper converts them back to the appropriate StAX events the <code class="literal">StAXSerializer</code> ca
 n write..</p></td></tr></table></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e643"></a>2.5.3.2.&nbsp;StAX-to-SAX pipeline</h4></div></div></div><p>This converter allows to mix StAX and SAX components - but is limited to starting with StAX and then switching to SAX. </p><div class="programlistingco"><pre class="programlisting">Pipeline&lt;PipelineComponent&gt; pipeStAX = <span class="hl-keyword">new</span> NonCachingPipeline&lt;StAXPipelineComponent&gt;();
+pipeStAX.execute();</pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>The pipeline uses a <code class="literal">StAXGenerator</code> - which produces StAX events.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/2.png" alt="2" border="0"></td><td valign="top" align="left"><p>In order to embed a single SAX component in a StAX pipeline, the <code class="literal">SAXForStAXPipelineWrapper</code> is needed. The constructor argument is the SAX component.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/3.png" alt="3" border="0"></td><td valign="top" align="left"><p>Altough the <code class="literal">CleaningTransformer</code> would emit SAX calls - the wrapper converts them back to the appropriate StAX events the <code class="literal">StAXSerializer</code> ca
 n write..</p></td></tr></table></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="d0e652"></a>2.5.3.2.&nbsp;StAX-to-SAX pipeline</h4></div></div></div><p>This converter allows to mix StAX and SAX components - but is limited to starting with StAX and then switching to SAX. </p><div class="programlistingco"><pre class="programlisting">Pipeline&lt;PipelineComponent&gt; pipeStAX = <span class="hl-keyword">new</span> NonCachingPipeline&lt;StAXPipelineComponent&gt;();
 pipeStAX.addComponent(<span class="hl-keyword">new</span> StAXGenerator(input));                                         <span class="co"><img src="images/callouts/1.png" alt="(1)"></span>
 pipeStAX.addComponent(<span class="hl-keyword">new</span> StAXToSAXPipelineAdapter());                                   <span class="co"><img src="images/callouts/2.png" alt="(2)"></span>
 pipeStAX.addComponent(<span class="hl-keyword">new</span> CleaningTransformer());                                        <span class="co"><img src="images/callouts/3.png" alt="(3)"></span>
 pipeStAX.addComponent(<span class="hl-keyword">new</span> XMLSerializer());                                              <span class="co"><img src="images/callouts/4.png" alt="(4)"></span>
 pipeStAX.setup(System.out);
-pipeStAX.execute();</pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>The pipeline starts with a <code class="literal">StAXGenerator</code>.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/2.png" alt="2" border="0"></td><td valign="top" align="left"><p>The adapter converts the StAX events to SAX method calls.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/3.png" alt="3" border="0"></td><td valign="top" align="left"><p>The <code class="literal">CleaningTransformer</code> is a SAX component.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/4.png" alt="4" border="0"></td><td valign="top" align="left"><p>The <code class="literal">XMLSerializer</code> writes the SAX method calls to a file.</p></td></tr></table></div></di
 v></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e678"></a>2.5.4.&nbsp;Java 1.5 support</h3></div></div></div><p>In order to use StAX with Java 1.5 an additional dependency is needed in the project's <code class="literal">pom.xml</code>. 
+pipeStAX.execute();</pre><div class="calloutlist"><table border="0" summary="Callout list"><tr><td width="5%" valign="top" align="left"><img src="images/callouts/1.png" alt="1" border="0"></td><td valign="top" align="left"><p>The pipeline starts with a <code class="literal">StAXGenerator</code>.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/2.png" alt="2" border="0"></td><td valign="top" align="left"><p>The adapter converts the StAX events to SAX method calls.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/3.png" alt="3" border="0"></td><td valign="top" align="left"><p>The <code class="literal">CleaningTransformer</code> is a SAX component.</p></td></tr><tr><td width="5%" valign="top" align="left"><img src="images/callouts/4.png" alt="4" border="0"></td><td valign="top" align="left"><p>The <code class="literal">XMLSerializer</code> writes the SAX method calls to a file.</p></td></tr></table></div></di
 v></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="d0e687"></a>2.5.4.&nbsp;Java 1.5 support</h3></div></div></div><p>In order to use StAX with Java 1.5 an additional dependency is needed in the project's <code class="literal">pom.xml</code>. 
       </p><pre class="programlisting">&lt;<span class="hl-tag">dependency</span>&gt;
   &lt;<span class="hl-tag">groupId</span>&gt;org.codehaus.woodstox&lt;<span class="hl-tag">/groupId</span>&gt;
   &lt;<span class="hl-tag">artifactId</span>&gt;wstx-asl&lt;<span class="hl-tag">/artifactId</span>&gt;
@@ -268,4 +270,4 @@
 &lt;<span class="hl-tag">/dependency</span>&gt;
 </pre><p>
       Using woodstox is simpler, as the reference implementation depends on JAXP 1.4, which is not part of Java 1.5.
-      </p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="pipelines.utils"></a>2.6.&nbsp;Utilities</h2></div></div></div><p>TBW: XMLUtils, TransformUtils</p></div></div><div xmlns:fo="http://www.w3.org/1999/XSL/Format" class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="introduction.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="sitemap.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;1.&nbsp;Introduction&nbsp;</td><td width="20%" align="center"><span style="color:white;font-size:85%;"><a href="http://cocoon.apache.org/3.0/" title="The Apache Cocoon community">The Apache Cocoon community</a></span></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;3.&nbsp;Sitemaps</
 td></tr></table></div></body></html>
+      </p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="pipelines.utils"></a>2.6.&nbsp;Utilities</h2></div></div></div><p>TBW: XMLUtils, TransformUtils</p></div></div><div xmlns:fo="http://www.w3.org/1999/XSL/Format" class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="introduction.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="sitemap.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;1.&nbsp;Introduction&nbsp;</td><td width="20%" align="center"><span style="color:white;font-size:85%;"><a href="http://cocoon.apache.org/3.0/" title="The Apache Cocoon community">The Apache Cocoon community</a></span></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;3.&nbsp;Sitemaps</
 td></tr></table></div></body></html>
\ No newline at end of file

Modified: cocoon/site/site/3.0/reference/html-single/sitemap.html
URL: http://svn.apache.org/viewvc/cocoon/site/site/3.0/reference/html-single/sitemap.html?rev=898101&r1=898100&r2=898101&view=diff
==============================================================================
--- cocoon/site/site/3.0/reference/html-single/sitemap.html (original)
+++ cocoon/site/site/3.0/reference/html-single/sitemap.html Mon Jan 11 22:47:02 2010
@@ -1,3 +1,3 @@
 <html><head>
       <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
-   <title>Chapter&nbsp;3.&nbsp;Sitemaps</title><link rel="stylesheet" href="css/html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="index.html" title="Cocoon 3.0 ALPHA - Reference Documentation"><link rel="up" href="index.html" title="Cocoon 3.0 ALPHA - Reference Documentation"><link rel="prev" href="pipelines.html" title="Chapter&nbsp;2.&nbsp;Pipelines"><link rel="next" href="webapps.html" title="Chapter&nbsp;4.&nbsp;Web applications"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:fo="http://www.w3.org/1999/XSL/Format" id="top"><div id="header"><div class="projectlogo"><a href="./"><img class="logoImage" src="images/cocoon_logo.jpg" alt="Apache Cocoon" border="0"></a></div></div></div><div xmlns:fo="http://www.w3.org/1999/XSL/Format" class="mhSpacer"></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="sitemap"></a>C
 hapter&nbsp;3.&nbsp;Sitemaps</h2></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sitemaps.definition"></a>3.1.&nbsp;What is a sitemap?</h2></div></div></div><p>TBW</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sitemaps.evaluation"></a>3.2.&nbsp;Sitemap evaluation?</h2></div></div></div><p>TBW</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sitemaps.expression-languages"></a>3.3.&nbsp;Expression languages</h2></div></div></div><p>TBW</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sitemaps.spring"></a>3.4.&nbsp;Spring integration</h2></div></div></div><p>TBW</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sitema
 ps.embedding"></a>3.5.&nbsp;Embedding a sitemap</h2></div></div></div><p>TBW</p></div></div><div xmlns:fo="http://www.w3.org/1999/XSL/Format" class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pipelines.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="webapps.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;2.&nbsp;Pipelines&nbsp;</td><td width="20%" align="center"><span style="color:white;font-size:85%;"><a href="http://cocoon.apache.org/3.0/" title="The Apache Cocoon community">The Apache Cocoon community</a></span></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;4.&nbsp;Web applications</td></tr></table></div></body></html>
+   <title>Chapter&nbsp;3.&nbsp;Sitemaps</title><link rel="stylesheet" href="css/html.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="index.html" title="Cocoon 3.0 ALPHA - Reference Documentation"><link rel="up" href="index.html" title="Cocoon 3.0 ALPHA - Reference Documentation"><link rel="prev" href="pipelines.html" title="Chapter&nbsp;2.&nbsp;Pipelines"><link rel="next" href="webapps.html" title="Chapter&nbsp;4.&nbsp;Web applications"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div xmlns:fo="http://www.w3.org/1999/XSL/Format" id="top"><div id="header"><div class="projectlogo"><a href="./"><img class="logoImage" src="images/cocoon_logo.jpg" alt="Apache Cocoon" border="0"></a></div></div></div><div xmlns:fo="http://www.w3.org/1999/XSL/Format" class="mhSpacer"></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="sitemap"></a>C
 hapter&nbsp;3.&nbsp;Sitemaps</h2></div></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sitemaps.definition"></a>3.1.&nbsp;What is a sitemap?</h2></div></div></div><p>TBW</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sitemaps.evaluation"></a>3.2.&nbsp;Sitemap evaluation?</h2></div></div></div><p>TBW</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sitemaps.expression-languages"></a>3.3.&nbsp;Expression languages</h2></div></div></div><p>TBW</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sitemaps.spring"></a>3.4.&nbsp;Spring integration</h2></div></div></div><p>TBW</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sitema
 ps.embedding"></a>3.5.&nbsp;Embedding a sitemap</h2></div></div></div><p>TBW</p></div></div><div xmlns:fo="http://www.w3.org/1999/XSL/Format" class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="pipelines.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="webapps.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter&nbsp;2.&nbsp;Pipelines&nbsp;</td><td width="20%" align="center"><span style="color:white;font-size:85%;"><a href="http://cocoon.apache.org/3.0/" title="The Apache Cocoon community">The Apache Cocoon community</a></span></td><td width="40%" align="right" valign="top">&nbsp;Chapter&nbsp;4.&nbsp;Web applications</td></tr></table></div></body></html>
\ No newline at end of file



Mime
View raw message