XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 5th, 2004, 07:03 AM
nor2004 nor2004 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 nor2004 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Problem Subtotalling In Xsl

Hi all,

I am having a problem, I have spent three days attempting to solve it but no luck yet.

I have a number of categories. Each has its own table and I have to subtotal it s values up to display a subtotal under the table. This is fine.
However if the category is 'Mutual Funds', 'Bond Funds', 'Short-term Funds', 'Stock Funds' or 'Other', I have to display all these category details in one table called Mutual funds. I have this much done but I cant figure out the subtotalling of all these categories together.

XSL snippet
<!--Mutual Funds-->
<xsl:if test="(contains($AllHoldings, 'Mutual Funds')) or (contains($AllHoldings, 'Stock Funds')) or (contains($AllHoldings, 'Bond Funds')) or (contains($AllHoldings, 'Short-term Funds')) or (contains($AllHoldings, 'Other')) ">
<table cellspacing="0" width="684" summary="Mutual Funds" class="holdings grid">
<caption>Mutual Funds</caption>
<xsl:call-template name="Headers"/>
<xsl:for-each select="Account_Holding_Asset_Category">
<xsl:variable name="textBeforePercent" select="substring-before(Hld_Acct_Pcent_Fnte, '%')"/>
<xsl:variable name="holdingsType" select="translate($textBeforePercent, '0123456789', '')"/>
<xsl:if test="(($holdingsType = 'Mutual Funds ') or ($holdingsType = 'Stock Funds ') or ($holdingsType = 'Bond Funds ') or ($holdingsType = 'Short-term Funds ') or ($holdingsType = 'Other '))">
<xsl:apply-templates select="Account_Security_Holding_Detail"/>
</xsl:if>
</xsl:for-each>
<tr class="total">
<td colspan="4">Subtotal of Mutual Funds</td>
<td></td>
<td><xsl:value-of select="sum(Account_Security_Holding_Detail/Hld_End_Sec_Mkt_Amt)"/></td>
<td class="rb">&nbsp;</td>
</tr>
</table>
</xsl:if>

XML snippet
<Account_Holding_Asset_Category>
<Hld_Acct_Pcent_Fnte>Mutual Funds 60% of holdings</Hld_Acct_Pcent_Fnte>
<Account_Security_Holding_Detail>
<Hld_Descr_Symb_Txt1>mfFIDELITY EQUITY INCOME ( FEQIX )</Hld_Descr_Symb_Txt1>
<Hld_Sec_Qty_Amt>95306</Hld_Sec_Qty_Amt>
<Hld_Sec_Prc_Amt>48.730</Hld_Sec_Prc_Amt>
<Hld_Sec_Cost>4,726.80</Hld_Sec_Cost>
<Hld_Beg_Sec_Mkt_Amt>4624.05</Hld_Beg_Sec_Mkt_Amt>
<Hld_End_Sec_Mkt_Amt>4644.26</Hld_End_Sec_Mkt_Amt>
</Account_Security_Holding_Detail>
<Account_Security_Holding_Detail>
<Hld_Descr_Symb_Txt1>mfFIDELITY FREEDOM 2010 ( FFFCX )</Hld_Descr_Symb_Txt1>
<Hld_Sec_Qty_Amt>93131</Hld_Sec_Qty_Amt>
<Hld_Sec_Prc_Amt>12.880</Hld_Sec_Prc_Amt>
<Hld_Sec_Cost>unknown</Hld_Sec_Cost>
<Hld_Beg_Sec_Mkt_Amt>1186.71</Hld_Beg_Sec_Mkt_Amt>
<Hld_End_Sec_Mkt_Amt>1199.53</Hld_End_Sec_Mkt_Amt>
</Account_Security_Holding_Detail>
</Account_Holding_Asset_Category>
<Account_Holding_Asset_Category>
<Hld_Acct_Pcent_Fnte>Bond Funds 23% holdings</Hld_Acct_Pcent_Fnte>
<Account_Security_Holding_Detail>
<Hld_Descr_Symb_Txt1>mfBond Fund ( SMT )</Hld_Descr_Symb_Txt1>
<Hld_Sec_Qty_Amt>4000</Hld_Sec_Qty_Amt>
<Hld_Sec_Prc_Amt>$87.720</Hld_Sec_Prc_Amt>
<Hld_Sec_Cost>$600.00</Hld_Sec_Cost>
<Hld_Beg_Sec_Mkt_Amt>12.34</Hld_Beg_Sec_Mkt_Amt>
<Hld_End_Sec_Mkt_Amt>9133.44</Hld_End_Sec_Mkt_Amt>
</Account_Security_Holding_Detail>
</Account_Holding_Asset_Category>
<Account_Holding_Asset_Category>
<Hld_Acct_Pcent_Fnte>Short-term Funds 4% holdings</Hld_Acct_Pcent_Fnte>
<Account_Security_Holding_Detail>
<Hld_Descr_Symb_Txt1>Short Term</Hld_Descr_Symb_Txt1>
<Hld_Sec_Qty_Amt>2.000</Hld_Sec_Qty_Amt>
<Hld_Sec_Prc_Amt>$47.720</Hld_Sec_Prc_Amt>
<Hld_Sec_Cost>$0.00</Hld_Sec_Cost>
<Hld_Beg_Sec_Mkt_Amt>97.34</Hld_Beg_Sec_Mkt_Amt>
<Hld_End_Sec_Mkt_Amt>95.44</Hld_End_Sec_Mkt_Amt>
</Account_Security_Holding_Detail>
</Account_Holding_Asset_Category>

Any help will be so much appreciated.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Problem Subtotalling In Xsl


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT