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

showing unique element values only

Subject: showing unique element values only
From: "Keith" <keith@xxxxxxxxxxxxx>
Date: Wed, 31 Jan 2001 12:07:36 -0600
xsl unique elements
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
&gt;'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@xxxxxxxxxxxxxxxxxx


 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.