cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philipp Burkert" <phil...@burkert.de>
Subject RE: (Easy) Passing a Variable From Sitemap to StyleSheet?
Date Sun, 11 Apr 2004 21:03:48 GMT
Hi,

> I thought this would be easy...I'm trying to pass a variable 
> defined in the Sitemap, and retrieve it in the Stylesheet.

first you have to handle the parameter to the transformer within the
sitemap.

---sitemap--
<map:match pattern="*/show.html">
   <map:generate src="xmldb:xindice-embed:///db/beschlusslage/"/>
   <map:transform type="xslt" src="xslt/antrag2html.xslt">
	<map:parameter name="oid" value="{1}"/>
   </map:transform> 
   ....
------------

Then you have to
- declare the parameter in the xslt
- and output it later with the $varname syntax

---xslt--
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8"
indent="yes"/>
	<xsl:param name="oid"/>
      ...
	<xsl:template match="meta" name="antrag">
         <xsl:value-of select="$oid"/>
      ...
------------

Hope that helps

PHILIPP BURKERT
philipp@burkert.de


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


Mime
View raw message