[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: A simple xsl:if question from a newbie
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@xxxxxxxxxxxxxxxxxxxxxxx | | op|qo WWW: http://www.informatik.hu-berlin.de/~obecker | \-------------------------------------------------------------------/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|