You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by marco <m....@pisa.iol.it> on 2000/10/30 14:50:59 UTC

parameter and xsp

Hi all

I have a problem with xsl:param and xsp.The problem is the following:
I have a Html page which sends some parameters to a Xml file to which a
Stylesheet Xsl is associate. In the Xsl file I take the parameters with:

<xsl:param name="scelta"/>
<xsl:param name="segno"/>
This works if I do not do any Xsp transformation. If I do a Xsp
transformation the Stylesheet does not take the parameters.
The text I use is:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<xsl:param name="segno">Ariete</xsl:param>
<xsl:param name="scelta">generale</xsl:param>
<xsl:template match="Oroscopo">
<xsl:processing-instruction
name="cocoon-process">type="xsp"</xsl:processing-instruction>
<xsl:processing-instruction
name="cocoon-process">type="xslt"</xsl:processing-instruction>
<xsl:processing-instruction name="xml-stylesheet">href="mostra-html.xsl"
type="text/xsl"</xsl:processing-instruction>
<xsp:page language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<xsl:copy>
<xsl:apply-templates select="Segno[Zodiaco=$segno]"/>
</xsl:copy>
</xsp:page>
</xsl:template>

<xsl:template match="Segno">
<xsl:copy>
<xsl:call-template name="Analizza"/>
</xsl:copy>
</xsl:template>

<xsl:template name="Analizza">
<xsl:choose>
<xsl:when test="contains($scelta,'generale')">
<xsl:value-of select="Generale/Descrizione"/>
</xsl:when>
<xsl:when test="contains($scelta,'amore')">
<xsl:value-of select="Aspetto[@code='Amore']/Descrizioneaspetto"/>
</xsl:when>
<xsl:when test="contains($scelta,'denaro')">
<xsl:value-of select="Aspetto[@code='Lavoro e
Denaro']/Descrizioneaspetto"/>
</xsl:when>
<xsl:when test="contains($scelta,'fortuna')">
<xsl:value-of select="Aspetto[@code='Fortuna']/Descrizioneaspetto"/>
</xsl:when>
</xsl:choose>
</xsl:template>

</xsl:stylesheet>

Where is the error?
Regards
Marco
m.spinetti@pisa.iol.it