cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sonny Sukumar" <>
Subject Re: Re: [XSP] Java variables within tag attributes
Date Sat, 01 Nov 2003 20:29:24 GMT

Ok, more specifically, here's what I did...

1.) I had a mostly static XHTML doc in which I wanted to fill in a 2-3 
sections with dynamic content.  For each such section I embedded a 
<mysite:content replace-with="someGeneralContentName"/>

2.) I wrote a simple stylesheet like:

<xsl:stylesheet version="1.0">
  <xsl:param name="pageTitle" select="'Welcome to'"/>

  <xsl:template match="mysite:content[@replace-with='pageTitle']">
    <cinclude:include src="{$pageTitle}"/>

  <xsl:template match="@*|node()" priority="-1">
      <xsl:apply-templates select="@*|node()"/>

As you can see, "pageTitle" is one instance of a general content name.

3.) In the sitemap you'd do something like:

<map:transform type="xslt" src="xsl/myStyleSheet.xsl">
  <map:parameter name="pageTitle" 
<map:transform type="cinclude"/>

That's about it. :-)


>From: Jan Wielgus <>
>Subject: Re: Re: [XSP] Java variables within tag attributes
>Date: Sat,  1 Nov 2003 21:20:50 +0100
> >Hi Jan,
> >
> >I did a similar thing by using by writing an XSLT stylesheet that
> >an xsl:param, passing the param from my sitemap using
>map:transform, and
> >having the XSLT stylesheet fill in the "src" attribute value for the
> ><cinclude>.  After that stage is done, you can pass it through the
> >"cinclude" transformer.
>Would you give me a little code-example, if possible?
>To unsubscribe, e-mail:
>For additional commands, e-mail:

Want to check if your PC is virus-infected?  Get a FREE computer virus scan 
online from McAfee.

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

View raw message