cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Gallardo" <>
Subject Re: Passing parameter from sitemap
Date Tue, 20 Jan 2004 07:33:54 GMT
Dmitry Diskin dijo:
> Hi,
> I'm looking for a way to pass some constant parameter from sitemap to
> all my xsl styles. Basically I need to replace multiple occurences (bad
> design! not mine :)) of "(c) 2001-2003" to something like "(c)
> 2001-${currentyear}", where "currentyear" will be defined in single
> place (sitemap, sub-sutemap?).

One posible solution is using XInclude. We use it to set some particular
variables for our applications. Note we use some generic xslt to make
rendering. I think this could help you too. Sample:

Description: We have some variables names for every application that have
his own values: application name, author, copyright notice, etc.

The solution using XInclude is very easy, just 3 steps:

Here is the basic XML that store this particular data for each application
(sorry the tags are in spanish, but I hope you can get the idea from):

1- Write a file with tags that will contain all the particular data for
each application:

********************** appdata.xml ******************************
    <nombre>My app name</nombre>
    <titulo>The title of the App</titulo>
    <elaborado>Who made the App</elaborado>
        <meta name="author" content="An author notice"/>
        <meta name="copyright" content="The copyright notice"/>
        <meta name="date" content="Start date"/>
    <documentacion>Who made the documentation</documentacion>

2-Then in a xslt we use XInclude:

************************** render2html.xslt *********************
<xsl:stylesheet version="1.0"
    <xsl:template match="document">
        <html lang="es-NI">

3-In the sitemap.xmap you will use the xinclude transformer after the
stylesheet that render the page. In this case render2html.xslt:

<map:transform src="stylesheets/render2html.xslt"/>
<map:transform type="xinclude"/>

For more info about XInclude:

I hope this help.

Best Regards,

Antonio Gallardo

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

View raw message