views:

15

answers:

2

I have a list grouped by Region and it currently shows all the items for each city. I want to reduce to only the most recent advisory for each city.

I have tried to use an xsl:for-each statement but I am messing up the names/parameters.

List is called mlc The list contains the fields: Title City Region Advisory DateCreated TT (calculated number field to find the number of minutes from the DateCreated to end of today which I intended to use the smallest to find the most recent)

I have the list grouped by Region and it currently shows all the items for each city. I want to reduce to only the most recent advisory for each city.

A: 

I had a co-worker help me and the code goes like this. City is sorted ascending. Created is sorted descending.

<xsl:if test="not(preceding-sibling::Row[1]/@City) or preceding-sibling::Row[1]/@City!=@City">

Now each city is shown only once and it is the most recent advisory.

Deborah Klenke
A: 

you mean you want the most recent by date? Are you using XSLT 1 or 2 ?

Oh and can you post some xml examples ?

Miguel de Melo