cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sylvain Wallez <>
Subject map:aggregate and views : what's the correct behaviour ?
Date Fri, 22 Mar 2002 23:10:25 GMT
Hi team,

I just fixed a bug in the treeprocessor which was not handling views in 
map:aggregate like the compiled engine (see However, this 
made me wonder about what should be the correct behaviour.

Let's consider the sitemap snippet that revealed the bug (from the docs 
sitemap) :

  <map:view name="content" from-label="content">
   <map:serialize type="xml"/>
   <map:match pattern="*.html">
    <map:aggregate element="site">
     <map:part src="cocoon:/book-{1}.xml"/>
     <map:part src="cocoon:/body-{1}.xml" label="content"/>
    <map:transform src="stylesheets/site2xhtml.xsl">

The label="content" on the 2nd part is used to select parts depending on 
the view. Both implementations do that equally well, that is, when 
requesting view "content", only "body-{1}.xml" is included.

The difference was about whether a part label should imply or not a jump 
to the view :
- the compiled engine automatically jumps to the view as soon as one 
map:part has a corresponding label even if the map:aggregate doesn't 
have this label.
- before fixing the bug, the interpreted engine jumped to the view 
_only_ if the map:aggregate also had a corresponding label (i.e. 
label="content" in the above snippet).

My opinion is that there are some uses case where automatic jump isn't 
good. Let's consider the following :
  <map:view name="books" from-label="books">
  <map:aggregate element="root">
    <map:part src="isbn-codes.xml" label="books"/>
    <map:part src="authors.xml"/>
  <map:transform src="isbn2books.xsl" label="books"/>
  <map:transform src="books2html.xsl"/>

The "books" view should give the list of books. With automatic jump, the 
above only gives a list of isbn codes and we cannot apply 
"isbn2books.xsl". On the contrary, explicit labels mean that there's no 
jump to the view from map:aggregate and that the stylesheet is correctly 

So, in short, my opinion is that labels of map:part should be for 
_selecting_ which parts belong to the view, and that view branching 
should depend _only_ on the labels of map:aggregate.

What is your opinion ?


Sylvain Wallez
 Anyware Technologies                  Apache Cocoon 

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

View raw message