cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From giacomo <giac...@apache.org>
Subject Re: [c2] still having caching problems
Date Wed, 09 May 2001 17:59:49 GMT


On Wed, 9 May 2001, Jeremy Quinn wrote:

> At 3:30 PM -0400 8/5/01, Donald Ball wrote:
> >    <map:act type="resource-exists">
> >     <parameter name="url" value="context://style/{1}.xsl"/>
> >     <map:transform src="style/{../1}.xsl"/>
> >    </map:act>
>
> Sorry if this is off-topic and I'm being real dumb .... but could someone
> explain what this bit does?
>
> OK, so it applies a stylesheet if it exists, but I do not understand the
> contents of these two attributes:
>
> 	value="context://style/{1}.xsl"
> 	src="style/{../1}.xsl"
>
> Why is there "{1}" in one and "{../1}" in the other?

It has to do with value substitution. I agree with you that the snipped
above dosn't make any sense concerning value substitution. Normally ie.
a matcher has a pattern attribute like pattern="foo/*". In this case the
matcher returns the value of the mached "*" back to the sitemap where
you can refer it in certain attribute like {1} inside the map:match
element. An action too can return
values back to the sitemap for substitution. Those components do that by
using a map. Matcher usually name their map entries 1, 2, ... actions
can use any names.

Now if you have the following:

  <map:mact pattern="foo/*">
    <map:act type="maAction">
      <map:generate src="foo/{../1}/{action-value}"/>
      ...
    </map:act>
  </map:match>

the {action-value} refers to a name in the map returned by the action
whereas the {../1} refers to the matchers map. The syntax using ../ was
taken from the XPath syntax to refer to the map above the current one.

Hope this helped you to understand.

Giacomo

>
>
> Thanks for any help
>
>
> regards Jeremy
> --
>    ___________________________________________________________________
>
>    Jeremy Quinn                                           Karma Divers
>                                                        webSpace Design
>                                             HyperMedia Research Centre
>
>    <mailto:sharkbait@mac.com>     		 <http://www.media.demon.co.uk>
>     <phone:+44.[0].20.7737.6831>        <pager:jermq@sms.genie.co.uk>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message