You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Sebastien Arbogast <se...@gmail.com> on 2005/04/13 05:02:25 UTC
Something I don't understand in i18n sample
Hi,
In the i18n sample sitemap there is a resource declaration like this :
<map:resource name="composite">
<map:aggregate element="root">
<map:part src="cocoon:/menu/{../0}"/>
<map:part src="cocoon:/content/{../0}" label="content"/>
</map:aggregate>
<map:transform src="simple2page.xsl">
<map:parameter name="page" value="{../0}"/>
<map:parameter name="locale" value="{../../locale}"/>
</map:transform>
<map:transform
src="context://samples/common/style/xsl/html/complex-page2html.xsl">
<map:parameter name="contextPath" value="{request:contextPath}"/>
</map:transform>
<map:serialize type="html"/>
</map:resource>
I don't understand the references to {../0}. What does this mean exactly ?
I don't understand the notation {../../locale} for the locale
parameter either. BTW there is a similar think in a pattern matching
further in the file :
<map:match pattern="content/*.xml">
<map:generate src="{1}.xml"/>
<map:transform type="i18n">
<map:parameter name="locale" value="{../locale}"/>
</map:transform>
<map:serialize/>
</map:match>
And I don't understand why the value for the locale parameter is
{../locale} and not {locale} as it's said in javadoc that LocaleAction
provides with a {locale} variable.
Any ideas of explanation ?
Thank you in advance.
--
Sebastien ARBOGAST
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Something I don't understand in i18n sample
Posted by Sebastien Arbogast <se...@gmail.com>.
Thank you very much.
On 4/13/05, Leszek Gawron <lg...@apache.org> wrote:
> Sebastien Arbogast wrote:
> > Hi,
> >
> > In the i18n sample sitemap there is a resource declaration like this :
> >
> > <map:resource name="composite">
> > <map:aggregate element="root">
> > <map:part src="cocoon:/menu/{../0}"/>
> > <map:part src="cocoon:/content/{../0}" label="content"/>
> > </map:aggregate>
> > <map:transform src="simple2page.xsl">
> > <map:parameter name="page" value="{../0}"/>
> > <map:parameter name="locale" value="{../../locale}"/>
> > </map:transform>
> > <map:transform
> > src="context://samples/common/style/xsl/html/complex-page2html.xsl">
> > <map:parameter name="contextPath" value="{request:contextPath}"/>
> > </map:transform>
> > <map:serialize type="html"/>
> > </map:resource>
> >
> > I don't understand the references to {../0}. What does this mean exactly ?
> > I don't understand the notation {../../locale} for the locale
> > parameter either. BTW there is a similar think in a pattern matching
> > further in the file :
> >
> > <map:match pattern="content/*.xml">
> > <map:generate src="{1}.xml"/>
> > <map:transform type="i18n">
> > <map:parameter name="locale" value="{../locale}"/>
> > </map:transform>
> > <map:serialize/>
> > </map:match>
> >
> > And I don't understand why the value for the locale parameter is
> > {../locale} and not {locale} as it's said in javadoc that LocaleAction
> > provides with a {locale} variable.
> > Any ideas of explanation ?
> >
> > Thank you in advance.
> >
> every matcher, action etc. puts it's parameters on the stack. If you do:
>
> <map:act type="foo"> <!-- this one puts "bar" on the stack -->
> <map:match pattern="*-*.xml"> <!-- this one puts "1" and "2" on the
> stack -->
> <map:generate src="{../bar}-{1}##{2}.xml"/> <!-- bar is not on top
> of the stack, use ../ to go deeper -->
> <map:serialize/>
> <map:match/>
> </map:act>
>
> {0} in case of matcher refers to full matched string so in case of
> foo-bar.xml and *-*.xml pattern:
>
> {1} - foo
> {2} - bar
> {0} - foo-bar.xml
>
> --
> Leszek Gawron MobileBox
> lgawron@apache.org http://www.mobilebox.pl
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
--
Sebastien ARBOGAST
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Something I don't understand in i18n sample
Posted by Leszek Gawron <lg...@apache.org>.
Sebastien Arbogast wrote:
> Hi,
>
> In the i18n sample sitemap there is a resource declaration like this :
>
> <map:resource name="composite">
> <map:aggregate element="root">
> <map:part src="cocoon:/menu/{../0}"/>
> <map:part src="cocoon:/content/{../0}" label="content"/>
> </map:aggregate>
> <map:transform src="simple2page.xsl">
> <map:parameter name="page" value="{../0}"/>
> <map:parameter name="locale" value="{../../locale}"/>
> </map:transform>
> <map:transform
> src="context://samples/common/style/xsl/html/complex-page2html.xsl">
> <map:parameter name="contextPath" value="{request:contextPath}"/>
> </map:transform>
> <map:serialize type="html"/>
> </map:resource>
>
> I don't understand the references to {../0}. What does this mean exactly ?
> I don't understand the notation {../../locale} for the locale
> parameter either. BTW there is a similar think in a pattern matching
> further in the file :
>
> <map:match pattern="content/*.xml">
> <map:generate src="{1}.xml"/>
> <map:transform type="i18n">
> <map:parameter name="locale" value="{../locale}"/>
> </map:transform>
> <map:serialize/>
> </map:match>
>
> And I don't understand why the value for the locale parameter is
> {../locale} and not {locale} as it's said in javadoc that LocaleAction
> provides with a {locale} variable.
> Any ideas of explanation ?
>
> Thank you in advance.
>
every matcher, action etc. puts it's parameters on the stack. If you do:
<map:act type="foo"> <!-- this one puts "bar" on the stack -->
<map:match pattern="*-*.xml"> <!-- this one puts "1" and "2" on the
stack -->
<map:generate src="{../bar}-{1}##{2}.xml"/> <!-- bar is not on top
of the stack, use ../ to go deeper -->
<map:serialize/>
<map:match/>
</map:act>
{0} in case of matcher refers to full matched string so in case of
foo-bar.xml and *-*.xml pattern:
{1} - foo
{2} - bar
{0} - foo-bar.xml
--
Leszek Gawron MobileBox
lgawron@apache.org http://www.mobilebox.pl
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org