This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: A simple xsl:if question from a newbie
- To: xsl-list at mulberrytech dot com
- Subject: Re: A simple xsl:if question from a newbie
- From: Oliver Becker <obecker at informatik dot hu-berlin dot de>
- Date: Wed, 19 Jul 2000 15:33:02 +0200 (MET DST)
- Reply-To: xsl-list at mulberrytech dot com
Hi Nicki,
> ----XSL-----
> <xsl:for-each select="ROWSET/ROW">
> <xsl:if test="substring(Starttime, 1, 10) = {Time}">
>
> <xsl:value-of select="Body"/>
> </xsl:if>
> </xsl:for-each>
> -----------
>
> Unfortunately the condition never returns true.
> Is there anyone who's got some suggestions as to
> why???
Two points:
- you have to consider (i.e. remove) whitespace characters (newlines)
- Time isn't accessed correctly
Something like this should work:
<xsl:variable name="time" select="normalize-space(Time)" />
<xsl:for-each select="ROWSET/ROW">
<xsl:if test="substring(normalize-space(Starttime), 1, 10) = $time">
<xsl:value-of select="Body"/>
</xsl:if>
</xsl:for-each>
Regards,
Oliver
/-------------------------------------------------------------------\
| ob|do Dipl.Inf. Oliver Becker |
| --+-- E-Mail: obecker@informatik.hu-berlin.de |
| op|qo WWW: http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list