cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: parameters
Date Sat, 09 Aug 2003 08:52:44 GMT
Andrzej Radzki wrote:

> Hello!
> 
> I want to add to the all links (<a href="..."/>) in my site

Where does the code come from?

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

How does the sitemap look like?

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 testing 
if @href already contains parameters and if yes replace the ? with &amp;.

Regards,

Joerg


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


Mime
View raw message