Subject: RE: [xsl] Removing duplicates|
From: Clay Leeds <cleeds@xxxxxxxxxx>
Date: Tue, 22 Oct 2002 16:22:18 -0700
" the preceding-sibling axis contains all the preceding siblings of the context node; if the context node is an attribute node or namespace node, the preceding-sibling axis is empty "
Sorry but I must be slow (it is late here). You only want to process RCs if there is no RC with the same value in the same DETAILLINE? Is that right?
DETAIL DETAILLINE RCDATA RCDATALINE RC TRC /RCDATALINE RCDATALINE RC TRC /RCDATALINE RCDATALINE RC TRC /RCDATALINE /RCDATA /DETAILLINE /DETAIL
<xsl:template match="RC"> <xsl:if test="not(ancestor::DETAILLINE/descendant::RC[count(following::RC|current()) = count(following::RC)][text()=current()/text()])"> ... </xsl:if> </xsl:template>
This says "look for RCs descending from the same DETAILLINE as this RC, where they have the same text value as this RC, and they have a following RC that is the same as this RC (i.e. they are a preceding RC)"
not(ancestor::RCDATA/descendant::TRC[count(following::TRC|current() = count(following::TRC)][text()=current()/text()])
There is probably a better way of doing this.
- Clay Leeds - Web Developer/Programmer - cleeds@xxxxxxxxxx