Re: alternating tags in a list?

Subject: Re: alternating tags in a list?
From: Guy_Murphy@xxxxxxxxxx
Date: Thu, 10 Dec 1998 17:29:31 +0000
Well sort of thinking out loud as it where...

You can evaluate conditions in XSL. As long as you can determine the index
of the current tag then you can produce alternating patterns by dividing by
your factor and checking the remainder, if it equals 0, it's the first of
sequence, 1 second in sequence and so on.

So you don't need to track state, just obtain index, evaluate a condition,
and perform basic arithmetic. You could do this without resorting to
script, but it would probably be more concise with script. It would IMHO be
a pity not to include script for these matters as it would mean bending the
simple XSL out of shape to occomodate these rare occurences. Such matters
are best expressed in a procedural language sniper, ie. a piece of script.

I've used this method many times when transforming data to HTML via ASP.

Personaly, if W3C doesn't include ECMAScript support in the final Rec I'll
be using the non-compliant variety of parser that does :)





xsl-list@xxxxxxxxxxxxxxxx on 12/10/98 06:16:26 PM

To:   xsl-list@xxxxxxxxxxxxxxxx
cc:    (bcc: Guy Murphy/UK/MAID)
Subject:  alternating tags in a list?




I think that's beyond the scope of XSL per se. To handle odd/even, you
either need a richer styling language, or you need some way to extend XSL.
Some early versions of XSL did have some ability to invoke a procedural
language such as ECMAscript, which could provide the "state" information
for this kind of toggling...
It occurs to me that what you probably _really_ want is not 2 columns, but
N columns, where N is chosen to suit the width of the presentation medium
and where the items are flowed from line to
line to fill out that width. Might be hard to express that in HTML... Do
the proposed XSL formatting objects allow one to express this kind of
"flowed grid of size-balanced items"?
______________________________________
Joe Kesselman  / IBM Research
Unless stated otherwise, all opinions are solely those of the author.


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






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


Current Thread