This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Template Matching


>
> I have XML coming from a SQL database.  The XSLT checks to see if the
> "IsActive" attribute in the z:row node is true.  If it is,
> then a checkbox
> is ticked.  I am having a little trouble understanding
> matching.  What is
> the most efficent template match for the processor? I can't find a
> definitive answer on what the first template match should be
> compared to the
> second template.  I am using template match="/" for the first
> and template
> match="rs:data" for the second.  Is there a better way?
>
At first glance I thought the structure of this stylesheet looked perfectly
OK.

The tests like
> 		<xsl:if test="z:row[@DayOfTheWeek='Sunday' and
> @IsActive='True']">

are saying "if there is a row with these attributes", which is fine.

But then I saw:
> 	<select name="start">
> 		<option>
> 			<xsl:value-of select="z:row/@StartTime"/>
> 		</option>
>
and that has me worried, because it selects the @StartTime attributes of all
the rows, and then displays the one that comes first, and ignores the rest.
In your example they're all the same, so it doesn't matter. But is this
actually the logic thaht's intended?

Mike Kay


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]