This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
showing unique element values only
- To: "Xsl-List \(E-mail 2\)" <xsl-list at lists dot mulberrytech dot com>
- Subject: [xsl] showing unique element values only
- From: "Keith" <keith at brooksweb dot com>
- Date: Wed, 31 Jan 2001 12:07:36 -0600
- Reply-To: xsl-list at lists dot mulberrytech dot com
Good day everyone,
I haven't posted a question in a while, but this one's got me..
consider the following xmlDoc structure..
====================
<FeeDetailsResponse>
<ACHFee feeID="xx">
<feeType>BuyRate</feeType>
<feeLevelBottom>.00</feeLevelBottom>
<feeLevelTop>1,000</feeLevelTop>
<feeVolumeBottom>1</feeVolumeBottom>
<feeVolumeTop>1,000</feeVolumeTop>
<feeSubmissionBottom>1</feeSubmissionBottom>
<feeSubmissionTop>1,000</feeSubmissionTop>
<feeAmount>xx</feeAmount>
<feePercent>xx</feePercent>
</ACHFee>
<ACHFee feeID="xx">
...
</ACHFee>
etc. etc.
</FeeDetailsResponse>
===================
What I have been trying to accomplish is creating a table-formatted page
that goes through each ACHFee/feeLevelBottom, feeVolumeBottom and
feeSubmissionBottom and builds a cell. In the cell I have the current()
Bottom element using format-number(), then it's
following-sibling::fee------Top, also using format-number(). The same type
of table is set up for each of the 'bottom' elements. Since this is a
'fee-structure' table, infinite combinations can be created. Using
functions such as 'split' or 'combine'(ie, split the first 0-1,000 cell into
a 0-500 cell and a 500.01-1,000 cell or combine a 0-1,000 cell with a
1,001-infinity cell)
I've tried manipulating the order of the ACHFee element with <xsl:sort
select="feeLevelBottom"/> and so-on. I've used every combination of
preceding::, following::, following-sibling:: that I can come up with, but
I still cannot make ONLY UNIQUE cell contents be displayed
========================snippet of xsl ==========
<xsl:for-each select="//ACHFee/feeLevelBottom">
<xsl:sort select="."/>
<xsl:if test="position()='1' or position()=last() or number(.) !=
number(preceding::*/feeLevelBottom)"><!--also used
preceding::ACHFee/feeLevelBottom and about a million other variations-->
<form name="xxx" id="Level" class="AdjustBuyRate">
<input type="hidden" name="feeLevelBottom"..>
<xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
</input>
<input type="hidden" name="feeLevelTop" ...>
<xsl:attribute name="value"><xsl:value-of
select="following-sibling::feeLevelTop"/></xsl:attribute>
</input>
<td align="center" valign="middle">
===============this is just for my testing=======
<br/>this=<xsl:value-of select="number(.)"/><br/><!-- this gives the
correct number-->
preceding=<xsl:value-of
select="number(preceding::ACHFee/feeLevelBottom)"/><br/><!--this however
gives me the previous number in reverse document order, not sort order,
there for my preceding != current test fails and the cell contents get
displayed-->
=================================================
<xsl:value-of select="format-number(.,'$#,###,###.00')"/><xsl:text> -
</xsl:text><xsl:if test="following-sibling::feeLevelTop
>'0'"><xsl:value-of
select="format-number(following-sibling::feeLevelTop,'$##.00')"/></xsl:if><b
r/>
<input type="text" name="splitLevel" ...>
<xsl:attribute name="class">L<xsl:value-of
select="../@feeID"/></xsl:attribute>
</input>
<xsl:text> </xsl:text>
<input type="button"
name="splitL"...onclick="javascript:AdjustFees(this.form,'splitL','{@feeID}'
)"/>
<br/>
<xsl:if test="position()!='1'">
<input type="button" name="combineL"...onclick="javascript:AdjustFees
(this.form,'combineL','{@feeID}')"/>
</xsl:if>
</td>
</form>
</xsl:if>
</xsl:for-each>
any ideas on how to get this accomplished would be greatly appreciated!
thanks,
kb
Keith Brooks
Software Developer
Global eTelecom
Keith@GlobaleTelecom.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list