[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Removing duplicates

Subject: RE: Removing duplicates
From: Clay Leeds <cleeds@xxxxxxxxxx>
Date: Wed, 23 Oct 2002 07:50:52 -0700
xsl position suppress
At 12:36 AM 10/23/2002, James Carlyle wrote:
I'm unable to help further because I don't know exactly what output you are
expecting.  You provided some sample input and a stylesheet that you were
unhappy with.   What I or anyone else would like to see is some short sample
output that is correct, and some short sample output that is incorrect, with
the differences highlighted.

The incorrect output would help me to understand your intent.

Sorry, here's what I'm referring to.


DESIRED OUTPUT:
===============
14 02
02
02
02
03 10 03

CURRENT OUTPUT:
===============
14 02
02
02 02
02 02
03 03 10 10 03 03

FYI: RC is an abbreviation for "Reason Code" (which is always displayed & not at issue) and TRC is "Translated Reason Code" (I want to suppress duplicate TRCs).

3rd DETAILLINE has 2 TRC = 02 - I want to suppress the 2nd TRC.
4th DETAILLINE has 2 TRC = 02 - I want to suppress the 2nd TRC.
    It also has a blank RC (which means it was overridden), &
    a TRC. This value is already being suppressed correctly.
5th DETAILLINE has 3 TRC = 03 and 2 TRC = 10 but I want to
    suppress the 2nd TRC & 3rd TRC. There is also a RC = 03
    but that should display since it is a RC (which should
    never be suppressed) and not a TRC.

I hope this is clear, and THANKS FOR THE HELP!

Web Maestro Clay

XSL INPUT:
==========
<xsl:for-each select="RCDATA/RCDATALINE">
<xsl:variable name="varRCDATAVALUE" select="RC"/>
<xsl:variable name="varTRCDATAVALUE" select="TRC"/>
<fo:inline>
<xsl:attribute name="color"><xsl:choose><xsl:when test="position() mod 2 = 0">#333333</xsl:when><xsl:otherwise>#000000</xsl:otherwise></xsl:choose></xsl:attribute>
<xsl:choose>
<xsl:when test="RC[.!=''] and TRC[.!='']">
<xsl:choose>
<xsl:when test="position()=1"><xsl:apply-templates select="TRC"/></xsl:when>
<xsl:when test="not(preceding-sibling::RCDATALINE/descendant::TRC[.= current()/text()])"><xsl:apply-templates select="TRC"/></xsl:when>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:if test="RC[.!='']">
<xsl:apply-templates select="RC"/>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<fo:inline>
<xsl:if test="RC[.!='']">
<xsl:if test="(position() mod 4) != 0 and not(position() = last())">
<fo:inline font-size="4pt">&#160;</fo:inline>
</xsl:if>
</xsl:if>
</fo:inline>
</fo:inline>
</xsl:for-each>



XML INPUT: ========== <DETAIL> <DETAILLINE> <SERVDESC> <SERVICE>99215</SERVICE> </SERVDESC> <QTY> 1</QTY> <CHARGE> 193.00</CHARGE> <RCDATA> <RCDATALINE> <RC>43</RC> <TRC>14</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> </DETAILLINE> <DETAILLINE> <SERVDESC> <SERVICE>20550</SERVICE> </SERVDESC> <QTY> 1</QTY> <CHARGE> 150.00</CHARGE> <RCDATA> <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> <RCDATALINE> <RC></RC> <TRC></TRC> </RCDATALINE> </RCDATA> </DETAILLINE> <DETAILLINE> <SERVDESC> <SERVICE>20550</SERVICE> </SERVDESC> <QTY> 1</QTY> <CHARGE> 150.00</CHARGE> <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> </DETAILLINE> <DETAILLINE> <SERVDESC> <SERVICE>29876</SERVICE> </SERVDESC> <QTY> 1</QTY> <CHARGE> 2800.00</CHARGE> <RCDATA> <RCDATALINE> <RC>01</RC> <TRC>02</TRC> </RCDATALINE> <RCDATALINE> <RC>04</RC> <TRC>02</TRC> </RCDATALINE> <RCDATALINE> <RC></RC> <TRC>03</TRC> </RCDATALINE> <RCDATALINE> <RC></RC> <TRC></TRC> </RCDATALINE> <RCDATALINE> <RC></RC> <TRC></TRC> </RCDATALINE> <RCDATALINE> <RC></RC> <TRC></TRC> </RCDATALINE> </RCDATA> </DETAILLINE> <DETAILLINE> <SERVDESC> <SERVICE>99212</SERVICE> </SERVDESC> <QTY> 1</QTY> <CHARGE> 75.00</CHARGE> <RCDATA> <RCDATALINE> <RC>10</RC> <TRC>03</TRC> </RCDATALINE> <RCDATALINE> <RC>12</RC> <TRC>03</TRC> </RCDATALINE> <RCDATALINE> <RC>24</RC> <TRC>10</TRC> </RCDATALINE> <RCDATALINE> <RC>22</RC> <TRC>10</TRC> </RCDATALINE> <RCDATALINE> <RC>03</RC> <TRC></TRC> </RCDATALINE> <RCDATALINE> <RC>09</RC> <TRC>03</TRC> </RCDATALINE> </RCDATA> </DETAILLINE> </DETAIL>


- Clay Leeds - Web Developer/Programmer - cleeds@xxxxxxxxxx


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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.