On Fri, 24 Oct 2003, Gianugo Rabellino wrote:

<snipped/>

> The more I think about it, though, the more I feel that this solution
> could be a usability boost for Cocoon. Probably hard to implement (even
> if the components part already does inheritance), but still very useful
> for complex Cocoon applications. And, in any case, even if _this_ is not
> the solution, I think that we should provide a way to have
> understandable and manageable sitemaps for complicated apps.

I'd rather see a solution similar to component inheritance because there
we have a clear anchor point to do inheritance. The pipeline inheritance
you've expressed would indeed be hard to implement as it is inheriting
at the matcher level which is already a final element in the sitemap
DTD. So why don't we think about inheriting hole pipelines similar to
components? As an example:

<pipeline>
    <match pattern="*.xml">
       <g type="file" src="{1}.xml/>
       <s/>
     </match>

    <match pattern="*.html">
       <g type="file" src="{1}.xml/>
       <t src="xml2html.xsl"/>
       <s type="html"/>
     </match>

    <match pattern="*.pdf">
       <g type="file" src="{1}.xml/>
       <t src="xml2fo.xsl"/>
       <s type="fo2pdf"/>
     </match>
</pipeline>

This is your propose sample pipeline and this

<sitemap extends="simple.xmap">
[...]
   <pipeline>
     <!-- Newly added case -->
    <match pattern="*.xls">
       <g type="file" src="{1}.xml/>
       <t src="xml2gnumeric.xsl"/>
       <s type="poi"/>
     </match>
   </pipeline>
</sitemap>

is your inherited one. I'd like to propose doing it like this:

<pipeline name="master">
    <match pattern="*.xml">
       <g type="file" src="{1}.xml/>
       <s/>
     </match>

    <match pattern="*.html">
       <g type="file" src="{1}.xml/>
       <t src="xml2html.xsl"/>
       <s type="html"/>
     </match>

    <match pattern="*.pdf">
       <g type="file" src="{1}.xml/>
       <t src="xml2fo.xsl"/>
       <s type="fo2pdf"/>
     </match>
</pipeline>

and

<sitemap>
[...]
   <pipeline extends="master">
     <!-- Newly added case -->
    <match pattern="*.xls">
       <g type="file" src="{1}.xml/>
       <t src="xml2gnumeric.xsl"/>
       <s type="poi"/>
     </match>
   </pipeline>
</sitemap>

I think is would be much easier to implement because pipelines cannot be
nested but matcher do (often). I feel it would be hard (performance
wise) to compare matchers of the same type and with the same pattern up
the tree (I know you are not proposing tree inheritance but simply
extending a template sitemap file)

What do you think about this?

--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com

Reply via email to