Suppress Repeating Values

Jon Bosker

Usenet Archive
Joined
Sep 26, 2003
Messages
6
Reaction score
0
Hi

I am trying to get my timesheet report to look good but my date keeps repeating and I do not want it to. I cannot understand how to implement the Meuchian technique here though it seems to be along the right lines.

Can anyone help me? I struggle with this XML stuff :(

At the moment my output looks like:
8/08/2003 7:25 AM 7:31 AM
8/08/2003 7:32 AM 5:23 PM

But I want it to look like:
8/08/2003 7:25 AM 7:31 AM
7:32 AM 5:23 PM <-- no date on 2nd line becuase it is the same

My data looks something like this:
<?xml version="1.0" standalone="yes"?>
<NewDataSet>
<timeDataDetails>
<Date>8/08/2003</Date>
<StartTime>7:25 AM</StartTime>
<EndTime>7:31 AM</EndTime>
</timeDataDetails>
<timeDataDetails>
<Date>8/08/2003</Date>
<StartTime>7:32 AM</StartTime>
<EndTime>5:23 PM</EndTime>
</timeDataDetails>
</NewDataSet>

and my style sheet looks something like this (note: I am outputting to HTML table):
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html><body><table> <xsl:for-each select="/NewDataSet/timeDataDetails"> <tr> <td><xsl:value-of select="Date"/></td> <td><xsl:value-of select="StartTime"/></td> <td><xsl:value-of select="EndTime"/></td> </tr> </xsl:for-each> </table></body></html>
 

Jon Bosker

Usenet Archive
Joined
Sep 26, 2003
Messages
6
Reaction score
0
In case anybody is having a similar problem I found a solution. It is as follows:
<xsl:if test="not(preceding-sibling::timeDataDetails[Date = current/Date])"> <xsl:value-of select="Date"/> </xsl:if>

Hope that helps
Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,799
Members
249,594
Latest member
henrywalsh

Latest Threads

Top