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]
Other format: [Raw text]

RE: Detecting a break in data


Hello Graham,

	
> I am new to XML and XSL (but old to more conventional 
> programming), and am
> having trouble trying to find a way to compare the value of a 
> field in one
> record with the same field in the previous record (sorry - I 
> suppose that
> should be node). 

So you want to compare only pairs, in that the comparison is between one
record and its immediate neighbour only?

> Basically, I want to print all the records 
> with a common
> category in one block, then print some kind of separator, 
> followed by all
> the records of the next block 

Here it sounds more like you want to group records by category, where any
record in the same category as any other gets lumped together, neighbours or
not.

...> I
> suspect that I am approaching the problem from the wrong 
> angle, given the
> bias of too many tens of years coding for-next loops in 
> various flavours

XSLT is a functional rather than a procedural language, so it doesn't have
for-next loops. If you really need them for some reason, eg doing something
six times, you can use recursive templates, but if you want group records /
nodes according to a category, that's an FAQ, assuming I've understood your
intentions.
Do you have some sample input and output?
Cheers,
Tom

 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]