cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrzej Radzki" <>
Subject RE: parameters
Date Sat, 09 Aug 2003 11:42:27 GMT
> Andrzej Radzki wrote:
> > Hello!
> >
> > I want to add to the all links (<a href="..."/>) in my site
> Where does the code come from?
Several transforms xsp|xml->xsl->xsl->html

> > additional
> > parameter (eg. ?param=value), without changing all files... is it
> > possible do this in the sitemap?
> How does the sitemap look like?

Main problem is that caching pages by proxy or browser using expire
header with complete URL. My site contains most static content but in
several languages, the locale parameter is attribute in session.

When I put for example:
<map:parameter name="expires" value="access plus 1 days"/>

Browser or proxy do not recognize language changes in session... so I
need always to pass parameter '?locale=xx' or '..&locale=xx' in URL. 

Some part of my sitemap:

<map:match pattern="step0_llf">
  <map:aggregate element="aggregate">
    <map:part src="cocoon:/step0_cf"/>
    <map:part src="cocoon://search/specs"/>
  <map:transform src="xsl/step0_cf.xsl"/>
  <map:serialize type="xml"/>

<map:match pattern="step0">
  <map:aggregate element="sitepage">
    <map:part src="cocoon://common/header/header_llf"
    <map:part src="cocoon://common/sitemenu/sitemenu_llf"
    <map:part src="cocoon:/step0_llf" element="sitebody"/>
    <map:part src="cocoon://common/footer/footer_llf"
  <map:transform src="xsl/step0_llf.xsl"/>
  <map:serialize type="html"/>

<map:match pattern="step0_cf">
  <map:generate type="serverpages" src="xsp/step0.xsp"/>
  <map:act type="locale">
    <map:transform type="i18n">
      <map:parameter name="locale" value="{locale}"/>
  <map:serialize type="xml"/>

> It's possible using an additional transformer:
> <xsl:template match="node()|@*">
>    <xsl:copy>
>      <xsl:apply-templates select="node()|@*"/>
>    </xsl:copy>
> </xsl:template>
> <xsl:template match="a/@href">
>    <xsl:attribute name="href">
>      <xsl:value-of select="."/>
>      <xsl:text>?param=value</xsl:text>
>    </xsl:attribute>
> </xsl:template>
> Of course you can add a better logic to the second template for
> if @href already contains parameters and if yes replace the ? with

It could be a solution but value /locale/ is dynamic... :(

> Regards,
> Joerg


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

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

View raw message