Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 25th, 2007, 07:55 PM
Registered User
 
Join Date: Jan 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to northwind Send a message via Yahoo to northwind
Default Getting the Total

==================XML============
<Process>
<BCC>
    <Queues>
    <QueueName>BCC</QueueName>
    <Total>45</Total>
    <Date>2007-04-19T00:00:00-06:00</Date>
    </Queues>

        <Queues>
    <QueueName>BCC_DISCREP</QueueName>
    <Total>2</Total>
    <Date>2007-04-19T00:00:00-06:00</Date>
    </Queues>

    <Queues>
        <QueueName>BCC_HOLD</QueueName>
    <Total>158</Total>
    <Date>2007-04-19T00:00:00-06:00</Date>
    </Queues>

    <Queues>
    <QueueName>BCC</QueueName>
    <Total>41</Total>
    <Date>2007-04-19T00:00:00-06:00</Date>
    </Queues>

        <Queues>
    <QueueName>BCC_DISCREP</QueueName>
    <Total>2</Total>
    <Date>2007-04-19T00:00:00-06:00</Date>
    </Queues>

    <Queues>
    <QueueName>BCC_HOLD</QueueName>
    <Total>158</Total>
    <Date>2007-04-19T00:00:00-06:00</Date>
    </Queues>

    <Queues>
    <QueueName>BCC</QueueName>
    <Total>40</Total>
    <Date>2007-04-18T00:00:00-06:00</Date>
    </Queues>

        <Queues>
    <QueueName>BCC_DISCREP</QueueName>
    <Total>2</Total>
    <Date>2007-04-18T00:00:00-06:00</Date>
    </Queues>

        <Queues>
    <QueueName>BCC_HOLD</QueueName>
    <Total>159</Total>
    <Date>2007-04-18T00:00:00-06:00</Date>
    </Queues>

</BCC>
</Process>

=======================xml=======

How to code it in xslt:

I wanna get the sum of all the <total> having the same date

Writing Software Application is just setting instructions to the code and there is nothing impossible.
 
Old April 26th, 2007, 03:40 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

This is quite easy in version 2.0 but if you are still on version 1.0, and most people are, then it looks like you need to use one of the standard grouping techniques. See the first post in this forum for a good tutorial on this. You will be grouping the queues based on the date but instead of for-each against the individual groups just use sum(Total). If you're still having problems then come back with more details.

--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Sub Total Rjh Reporting Services 0 June 21st, 2006 04:11 PM
Matrix Sub Total r_ganesh76 Reporting Services 1 March 9th, 2006 06:27 AM
Grand Total mateenmohd Access 6 April 8th, 2005 07:30 AM
Running Total jdmorr SQL Language 5 March 9th, 2005 03:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.