RE: [xsl] Removing duplicates

Subject: RE: [xsl] Removing duplicates
From: "James Carlyle" <james.carlyle@xxxxxxxxxxxx>
Date: Thu, 17 Oct 2002 20:24:45 +0100
Clay

> I need to make certain that I don't print the same value twice on
> a detail
> line. I have up to 6 values, and I've been trying to brute force it, by
> making certain it's not equal to a previous item (see below). I
> display the
> RC, unless a corresponding TRC exists.

I understand that you want to process RC elements unless there is a
preceding RC with the same value.  Is this correct?

If so, try this:

<xsl:template match="/RCDATA">
...
<xsl:for-each select="RCDATALINE">
	<xsl:apply-templates select="RC"/>
</xsl:for-each>
...
</xsl:template>

<xsl:template match="RC">
	<xsl:if test="not(preceding::RC[text()=current()/text()])">
		...
	</xsl:if>
</xsl:template>

Kind regards,

James Carlyle

FableFlow : MMS templating and delivery
Multimedia Messaging commentary : http://www.fableflow.com/weblog/


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


Current Thread