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

RE: Totals for conditional sums ?maybe?

Subject: RE: Totals for conditional sums ?maybe?
From: "Christopher Pierce" <Christopher.Pierce@xxxxxxxxxxx>
Date: Tue, 6 Dec 2005 13:06:11 -0500
christopher pierce
Data:

<AwardFullData>
	<AwardItemizedLine>
		<periodLinePeriodNumber></periodLinePeriodNumber>
		<transactionAmount>$1,804.00</transactionAmount>
	</AwardItemizedLine>
	<AwardItemizedLine>
		<periodLinePeriodNumber></periodLinePeriodNumber>
		<transactionAmount>$600.00</transactionAmount>
	</AwardItemizedLine>
	<AwardItemizedLine>
		<periodLinePeriodNumber>1</periodLinePeriodNumber>
		<transactionAmount>$600.00</transactionAmount>
	</AwardItemizedLine>
	<AwardItemizedLine>
		<periodLinePeriodNumber>2</periodLinePeriodNumber>
		<transactionAmount>$600.00</transactionAmount>
	</AwardItemizedLine>
	......
</AwardFullData>


This statement strips all non-numeric characters (haven't made it to
reformating back to $###,###.## yet):

<xsl:value-of
select="(translate(//AwardFullData/AwardItemizedLine/transactionAmount,t
ranslate(//AwardFullData/AwardItemizedLine/transactionAmount,'0123456789
', ''), ''))"/>

Result when applied to data: 180400


This statement is supposed to sum transactionAmount where count of
periodLinePeriodNumber <1

<xsl:value-of
select="sum(translate(//AwardFullData/AwardItemizedLine[count(./periodLi
nePeriodNumber)&lt;1]/transactionAmount,translate(//AwardFullData/AwardI
temizedLine[count(./periodLinePeriodNumber)&lt;1]/transactionAmount,'012
3456789', ''), ''))"/>

Result when applied to data: Can not convert #STRING to a NodeList!


Any suggestions?

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.