cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Javier Puerto <>
Subject Re: COCOON3-103
Date Tue, 25 Sep 2012 10:27:54 GMT
Hi Jos

2012/9/25 Jos Snellings <>

> Yesterday, I had a closer look upon COCOON3-103.
> Here is a better restatement of the problem:
> The "ObjectModel" keeps hold of the sitemap parameters and other variables.
> In SitemapParametersStack, a series of parameters is pushed upon the
> stack
> - whenever a 'pattern match ' occurs  (map:match element)
> - when a "when" condition matches
> Here is a simple case that does not work:
>        <map:match name="matcherOne" pattern="selecttest/{para1}">
>             <map:generate src="static/lyrics/le_bistrot.xml"/>
>             <map:select value="{map:para1}">
>                 <map:when equals="one">
>                     <map:transform src="xslt/song.xsl">
>                         <map:parameter name="para1" value="{map:para1}"/>

AFAIK, It should be:
<map:parameter name="para1" value="{map:../para1}"/>

(in this case, para1 = "one") :)

>                     </map:transform>
>                     <map:serialize type="html"/>
>                 </map:when>
>                 <map:otherwise>
>                     <map:serialize type="xml"/>
>                 </map:otherwise>
>             </map:select>
>         </map:match>

> The trouble is with "getParameter" of SitemapParametersStack:
>  - in this case, there is a match for relativeParameterMatcher,
>  but subsequently the variable "level" is not correctly computed and only
> the last entry is taken to hold the parameter.
> I can fix that, so that parameters always get matched if they are on the
> stack, but my real question is:
> what is meant to happen? Is there a "scope" foreseen for sitemap
> parameters? Is there an 'absolute' and a 'relative' matching,
> are notations foreseen that look like:
>  bla/blu
>   or
>  ../../../bla

I think that this was the only way to get the parameters because you can
have nested another matcher inside with a different parameter. The "../" is
just the notation to climb up the tree.

> and what with  /{justAName} ?

Also I think that absolute is not used.

> In any case, this mechanism does not work for the moment.
> If you folks can explain me what the idea is, I can gladly provide a
> patch. I have nothing to do these days.

Thanks, that would be great, I've explained how I remember that it works
but maybe someone wants to add something.

> Cheers,
> Jos


View raw message