[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

Subject: Re: A simple xsl:if question from a newbie
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 19 Jul 2000 13:33:57 GMT
simple xsl if example
> My XML-file looks somthing like this
I hope it's just your example but:
<ROW id=0>
isn't well formed (missing quotes around the attribute value)
Also if id were of type ID (specified in a DTD) you couldn't have
start its value with a digit.

However ignoring that,

	<xsl:if test="substring(Starttime, 1, 10) = {Time}"> 

The {} is a syntax error, if you miss them out you get

	<xsl:if test="substring(Starttime, 1, 10) = Time"> 

which is valid but would test against a Time child of the current ROW
element, what you actually want is

	<xsl:if test="substring(Starttime, 1, 10) = /page/Time"> 

except that your substring indexes are wrong as the first character
in all your StartTime examples, and your Time example, is a newline
not the first digit.

So probably you want


	<xsl:if test="contains(Starttime, normalize-space(/page/Time))"> 

which should probably be optimised by sticking
<xsl:variable name="time" select="normalize-space(/page/Time)"/>
at the top level of your stylesheet, then

<xsl:if test="contains(Starttime, $time">


David


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.