|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Removing duplicates
Howdy,
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. BTW, the code below doesn't work (still trying to iron out the kinks). Is there a shorter way to do this? (i.e., one that actually uses XPath :-) XML INPUT:
<RCDATA>
<RCDATALINE>
<RC>66</RC>
<TRC>02</TRC>
</RCDATALINE>
<RCDATALINE>
<RC>01</RC>
<TRC>02</TRC>
</RCDATALINE>
<RCDATALINE>
<RC></RC>
<TRC></TRC>
</RCDATALINE>
<RCDATALINE>
<RC></RC>
<TRC></TRC>
</RCDATALINE>
<RCDATALINE>
<RC></RC>
<TRC></TRC>
</RCDATALINE>
<RCDATALINE>
<RC></RC>
<TRC></TRC>
</RCDATALINE>
</RCDATA>
<xsl:for-each select="RCDATALINE"> <xsl:choose> <xsl:when test="RCDATALINE[1]"> <xsl:apply-templates select="RC"/> </xsl:when> <xsl:when test="RCDATALINE[2] and RC[.!=RC[1]]"> <xsl:apply-templates select="RC"/> </xsl:when> <xsl:when test="RCDATALINE[3] and RC[.!=RC[1]] and RC[.!=RC[2]]"> <xsl:apply-templates select="RC"/> </xsl:when> <xsl:when test="RCDATALINE[4] and RC[.!=RC[1]] and RC[.!=RC[2]] and RC[.!=RC[3]]"> <xsl:apply-templates select="RC"/> </xsl:when> <xsl:when test="RCDATALINE[5] and RC[.!=RC[1]] and RC[.!=RC[2]] and RC[.!=RC[3]] and RC[.!=RC[4]]"> <xsl:apply-templates select="RC"/> </xsl:when> <xsl:when test="RCDATALINE[6] and RC[.!=RC[1]] and RC[.!=RC[2]] and RC[.!=RC[3]] and RC[.!=RC[4]] and RC[.!=RC[5]]"> <xsl:apply-templates select="RC"/> </xsl:when> </xsl:choose> </xsl:for-each>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








