Subject: parameter problems
From: "Mark Edwards" <medwards@xxxxxxxxx>
Date: Sat, 7 Jul 2001 14:00:51 +1000
|
hi.
I have a stylesheet fragment here....
<xsl:template match="faqs">
<table border="2" width="100%">
<tr><td>
<xsl:apply-templates select="faq">
<xsl:with-param name="fmt">
<xsl:value-of select="'yes'" />
</xsl:with-param>
</xsl:apply-templates>
</td></tr>
<tr><td>
<xsl:apply-templates select="faq" >
<xsl:with-param name="fmt">
<xsl:value-of select="'no'" />
</xsl:with-param>
</xsl:apply-templates>
</td></tr>
</table>
</xsl:template>
<xsl:template match="faq">
<xsl:choose>
<xsl:when test="$fmt='yes'">
<b><xsl:value-of select="question"/></b><br />
</xsl:when>
<xsl:otherwise>
<b><xsl:value-of select="question"/></b><br />
<xsl:value-of select="answer"/><br />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
however my XSLT transformer cannot recognise the variable '$fmt'.
Please forgive what may be an obvious question - I'm new to this... but....
Am I doing something wrong here?
If have also tried:
<xsl:with-param name="fmt" select="'yes'" />
instead of
<xsl:with-param name="fmt">
<xsl:value-of select="'yes'" />
</xsl:with-param>
Any help would be much appreciated.
Mark.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|