cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <>
Subject Re: [RT] reconsidering pipeline semantics
Date Mon, 08 Jul 2002 20:35:07 GMT
Stefano Mazzocchi wrote:
> Right now, the note proposed by Eve Maler and Norm Walsh (long time
> contributors of the document-centric XML/SGML world) is a sort of 'ant
> build file for xml processing'. Indeed powerful, but limited in scope
> and many believe too document-oriented.
> I wouldn't personally wait for such a standard to emerge soon. And even
> if it does, I wouldn't bet it would allow us to replace our sitemap with
> it.

I don't think it would replace Cocoons sitemap, nor should it.
The sitemap does, in short, three different things
- declare component classes
- declare pipelines, and fill them with components
- declare mappings from URLs to pipelines (or, in general, to
   a processor for the request)
Admittedly, the sitemap maps also parameter values, cookie values
and everythig else to pipelines, whether this is a good idea or

General pipelining will only deal with the second, and will
only use a very simplified form of the first, if at all.

Well, switch back to the thread topic (pipeline semantics)
Start with an analogy: You have a set of related XML
documents which contains a lot of certain personal data.
You have several choices to deal with this:
- Extreme 1: Expand all the personal dataa whereever it is
   used, for  examaple "contact: J.R.Hacker, Phone 1234567
   and D.A. User, Email"
   (use markup as needed)
   Obvious advantage: easy editing of all the docs
   Obvious disadvantage: redundancy, maintenance problems lurking
- Extreme 2: Have one document as a central repository which
   contains all of the personal data and reference them, for
     <person id="jrh0001">
         <phone type="home">1234567</phone>
         <phone type="mobile">99887766</phone>
    <person id="dau0231">
   <!-- other doc --> "contact: <personref idref="jrh0001"/> and
    <personref idref="dau0231"/>"
   Obvious advantage: No redundancy, easier maintenance:
   Obvious disadvantage: needs discipline for data entry, needs
   tools to avoid dangling references.
- Middle ground: Use a person element which can contain either a
   full definition or a reference to a full definition:
   "contact: <person><personref idref="jrh0001"/></person> and
      <contact><email type="unspecified"></email></contact>
   Advantages: Documents can be edited with full definitions if
   necessary. Definitions can be moved automatically from documents
   to the  repository and replaced by references, and vice-versa,
   as needed.
   Disadvantages: Needs tool support. <insert more here>.

Apply the principles above to pipelines. A simple pipeline is
an instance of the pipeline component, filled with other component
instances. Let's say the instances could be declared in place, or
referenced (note: no matchers or actions, only processors allowed)
  <!-- declare a few processors -->
  <processordef id="foogenerator" role="filegenerator"
    <param name="name"/>
  <processordef id="aggregate-and-make-html" role="pipeline">
    <param name="name"/>
    <processorref idref="foogenerator">
      <with-param name="name" value="{name}"/>
    <processordef role="xslt" src="ref-to-xinclude"/>
    <processorref idref="generic-xinclude"/>
    <processordef idref="doc-to-html"/>
    <processordef role="serializer">
  <!-- map a URL to a processor -->
  <map match="foo/*.html">
    <processorref idref="aggregate-and-make-html">
      <with-param name="name" value="{1}"/>
  <!-- map another URL to a processor -->
  <map match="download/*.tar.gz">
    <processordef role="pipeline>
      <param name="name" value="{1}"/>
      <processordef role="targenerator" src="/path/to/dnld/{name}">
        <param name="name" value="{name}"/>
      <processordef role="gzip">
        <param name="method" value="nocompress"/>
Well, parametrization probably needs some work. I left out
the <processor> around the defs and refs inside the pipeline,
as this seems to be too verbose.
You can replace "ref" by "call" or whatever if you want to.

Well, enough for today

To unsubscribe, e-mail:
For additional commands, email:

View raw message