Title: RE: XSL-Problem. I can't find the error

> -----Original Message-----
> From: Geert Josten [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 16, 2006 12:42 PM
> To: [email protected]
> Subject: Re: XSL-Problem. I can't find the error
>
> Hi,
>
> It is a bit confusing that you are referring to XSP pages as
> .xsl files.

Well, that's right. Maybe I'll change it.

> Apart from that, your snippet looks okay on first
> impression. You are passing {request-param:typ} as a
> map:parameter to the relevant map:transforms, as far as I can
> see just from glancing at it. I do notice that you are using
> xinclude. Are you performing HTTP requests to Cocoon
> internally with Xinclude? If so, pass the query string on to
> it

That was the step I had forgotten. Now I have the parameter in the xsl-file.
But fo rany reason, the if-Clause isn't executed. Could you please have a look again?

Here is the code:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:param name="typ"/>

<xsl:template match="/">

        <html>
        <head>
                <script type="text/_javascript_">
                        highlight(color, key) {
                                .getElementById(key).style.backgroundColor = color;
                                }
                               
                        openBvh(bvh_id, session) {
                                = window.open('http://localhost:8080/cocoon/app/bsf-brandschutz?id=5', '_blank');
                                .focus();
                                }
                               
                        updateDetails(id) {
                                .open("http://web.de");
                                }
                                       
                </script>
        </head>
                <body>
                <table align="center" border="1" cellpadding="3" cellspacing="3" >
                        <tbody>
                                <tr>
                                        <th>Beschreibung <xsl:value-of select="$typ" /></th><th>Ähnlichkeit</th>
                                </tr>
                                <xsl:apply-templates />
                        </tbody>
                </table>

                </body>
        </html>
</xsl:template>

<xsl:template match="ergebnis">
<xsl:for-each select="objekt">
<tr>
<xsl:attribute name="onmouseover">highlight('yellow', '<xsl:value-of select="@id"/>')</xsl:attribute>
<xsl:attribute name="onmouseout">highlight('white', '<xsl:value-of select="@id"/>')</xsl:attribute>
<xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
<xsl:attribute name="ondblclick">openBvh('<xsl:value-of select='bauvorhaben'/>')</xsl:attribute>
<xsl:attribute name="ondblclick">updateDetails('<xsl:value-of select='@id'/>')</xsl:attribute>

<!-- THIS PART ISN'T WORKING -->
<xsl:if test="$typ = A">
        <xsl:variable name="stock" select="@stockwerk"></xsl:variable>
        <xsl:if test="$stock != '' ">
                <td><xsl:value-of select="@typ" /> in Stockwerk "$stock" von Gebaeude "<xsl:value-of select="gebaeude" />" in Bauvorhaben "<xsl:value-of select="bauvorhaben" />"</td>

                <td align="center"><b><xsl:value-of select="gesamtSim" /></b></td>
        </xsl:if>
        <xsl:otherwise>
        <td>Gebaeude "<xsl:value-of select="gebaeude" />" in Bauvorhaben "<xsl:value-of select="bauvorhaben" />"</td>
        <td align="center"><b><xsl:value-of select="gesamtSim" /></b></td>
        </xsl:otherwise>
</xsl:if>
<xsl:if test="$typ = B">
<td><xsl:value-of select="@typ" /> "<xsl:value-of select="bezeichnung" />" aus Bauvorhaben
                        "<xsl:value-of select="bauvorhaben" />" in Gebaeude "<xsl:value-of select="gebaeude" />"</td>
                        <td align="center"><b><xsl:value-of select="gesamtSim" /></b>
</td>
</xsl:if>
<xsl:otherwise>noch
</xsl:otherwise>
<!--______________________________-->

</tr>
</xsl:for-each>
</xsl:template>

</xsl:stylesheet>



Thanks, Barthi!