You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by js...@apache.org on 2002/12/11 21:02:46 UTC

cvs commit: jakarta-commons-sandbox/jelly/xdocs pipeline.xml navigation.xml

jstrachan    2002/12/11 12:02:46

  Modified:    jelly/xdocs navigation.xml
  Added:       jelly/xdocs pipeline.xml
  Log:
  Added a new document on XML pipelining with Jelly
  
  Revision  Changes    Path
  1.17      +10 -9     jakarta-commons-sandbox/jelly/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/jelly/xdocs/navigation.xml,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- navigation.xml	20 Sep 2002 13:44:38 -0000	1.16
  +++ navigation.xml	11 Dec 2002 20:02:46 -0000	1.17
  @@ -9,28 +9,29 @@
         <item name="Overview"                href="/index.html"/>
         <item name="FAQ"                     href="/faq.html"/>
         <item name="Getting Started"         href="/gettingstarted.html"/>
  -      <item name="Tutorial"         	   href="/tutorial.html"/>
  +      <item name="Tutorial"         	     href="/tutorial.html"/>
         <item name="Detail"                  href="/overview.html"/>
  -      <item name="Tag Reference"           href="/tags.html"/>
         <item name="Download"                href="http://www.ibiblio.org/maven/commons-jelly/distributions/"/>
       </menu>
       <menu name="Community">
         <item name="News Blog"			         href="http://blogs.werken.com/projects/jelly/"/>
  -      <item name="IRC"					           href="/irc.html"/>
  +      <item name="IRC"					   				 href="/irc.html"/>
         <item name="Powered By"              href="/powered.html"/>
         <item name="To Do List"              href="/todo.html"/>
       </menu>
  -    <menu name="Libraries">
  +    <menu name="Features">
         <item name="JellyUnit"               href="/jellyunit.html"/>
         <item name="JellySwing"              href="/jellyswing.html"/>
  +      <item name="XML Pipeline"            href="/pipeline.html"/>
  +      <item name="Tag Reference"           href="/tags.html"/>
       </menu>
       
       <menu name="Jakarta Community">
  -        <item name="Get Involved"           href="http://jakarta.apache.org/site/getinvolved.html"/>
  -        <item name="License"                href="http://jakarta.apache.org/commons/license.html"/>
  -        <item name="Mailing Lists"          href="http://jakarta.apache.org/site/mail.html"/>
  -        <item name="CVS Repositories"       href="http://jakarta.apache.org/site/cvsindex.html"/>
  -        <item name="Who We Are"             href="http://jakarta.apache.org/site/whoweare.html"/>
  +			<item name="Get Involved"            href="http://jakarta.apache.org/site/getinvolved.html"/>
  +			<item name="License"                 href="http://jakarta.apache.org/commons/license.html"/>
  +			<item name="Mailing Lists"           href="http://jakarta.apache.org/site/mail.html"/>
  +			<item name="CVS Repositories"        href="http://jakarta.apache.org/site/cvsindex.html"/>
  +			<item name="Who We Are"              href="http://jakarta.apache.org/site/whoweare.html"/>
       </menu>
     </body>
   </project>
  
  
  
  1.1                  jakarta-commons-sandbox/jelly/xdocs/pipeline.xml
  
  Index: pipeline.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <document>
  
   <properties>
    <title>XML Pipelines</title>
    <author email="jstrachan@apache.org">James Strachan</author>
   </properties>
  
  <body>
  
  <section name="XML Pipelines">
  
  <p>
  Rather like the Cocoon project, Jelly also supports the concept of <i>XML pipelines</i>.
  The idea in an XML pipeline is for XML events to be created by some generator and then
  flow through multiple filters, transformers or processors to some ultimate output.
  Currently XML events are implemented via <a href="http://sax.sf.net/">SAX</a>. 
  </p>
  
  
  <subsection name="A Jelly script is a compiled SAX stream">
  <p>
  Jelly compiles XML into a <a href="apidocs/org/apache/commons/jelly/Script.html">Script</a>.
  This mechanism works just the same whether the document is totally static, partially dynamic, 
  with just a few dynamic expressions inside it, or its totally dynamic using XML pipelines or invoking SOAP services etc.
  </p>
  <p>
  Jelly effectively turns XML into an executable Script that when its run will output XML events. 
  So this is effectively a dynamic XML event cache. The Script can contain dynamic fragments.
  This means that at runtime, there is no need to parse the script as the compiled Script can be cached which avoids unnecessary 
  XML parsers while still keeping content dynamic.
  </p>
  
  </subsection>
  	
  <subsection name="Using Tags as source, filter, transformation or destination in a pipeline">
  
  <p>
  Each Jelly <a href="apidocs/org/apache/commons/jelly/Tag.html">Tag</a> 
  is given an <a href="apidocs/org/apache/commons/jelly/XMLOutput.html">XMLOutput</a> 
  instance when it is invoked via the doTag() method. 
  The XMLOutput instance is a simple lightweigtht wrapper around SAX 
  ContentHandler and LexicalHandler instances allowing a Tag to take part in any 
  kind of SAX based processing of XML events.
  </p>
  
  <p>
  A Jelly Tag can choose how to invoke its body. So it could 
  </p>
  
  <ul>
  	<li>
  		optionally evaluate its body based on some condition
  	</li>
  	<li>
  		loop over its body via some iteration
  	</li>
  	<li>
  		parse its body into some DOM model or turn the XML events into some kind of Java objects 
  		or other kind of data structure
  	</li>
  	<li>
  		perform some arbitrary XML event transformation, like XSLT or apply some SAX Filter etc.
  	</li>
  	<li>
  		output the XML events to some destination
  	</li>
  </ul>
  
  <p>
  This means that by nesting Jelly tags together its possible to create simple or complex XML pipelines 
  which can be easily integrated with expression languages (like Jexl and XPath) 
  or scripting languages (like JavaScript, Jython etc) as well as using other technologies such as
  </p>
  
  <ul>
  	<li>
  		parsing XML, transforming it with XSLT or using XPath via the <a href="">xml</a> library
  	</li>
  	<li>
  		parsing HTML via the <a href="tags.html#jelly:html">html</a> library
  	</li>
  	<li>
  		performing XML validation against DTD, XML Schema or RelaxNG using the <a href="tags.html#jelly:validate">validate</a> library
  	</li>
  	<li>
  		performing SOAP operations via Apache Axis with the <a href="tags.html#jelly:soap">soap</a> library
  	</li>
  	<li>
  		mixing and matching the processing of XML in pipelines with support for other libraries like 
  		Ant, SQL, HTTP, JMS etc.
  	</li>
  </ul>
  
  <p>
  It should be noted that highly complex, yet easy to use XML pipelines can be created since the 
  pipelines don't have to be linear. At any point in the chain, custom logic can decide what to do next.
  </p>
  
  <pre>
    &lt;j:if test="${myBean.fooEnabled('uk')}&gt;
      &lt;j:file name="${userdir}/results.html"&gt;
        &lt;x:transform xslt="asHTML.xsl"&gt;
          &lt;soap:invoke endpoint="http://com.myserver/..."&gt;
            &lt;x:transform xslt="foo.xsl"&gt;
              &lt;x:parse xml="${myBean.getSomeURL()}"/&gt;
            &lt;x:transform&gt;
          &lt;/soap:invoke&gt;
        &lt;/x:transform&gt;
      &lt;/j:file&gt;
    &lt;/j:if&gt;		
  </pre>
  
  </subsection>.
  
  
  </section>
  
  </body>
  
  </document>
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>