Solved

XSL sum help

Posted on 2015-01-19
2
155 Views
Last Modified: 2015-01-20
Using an .XSL stylesheet and the sample xml below, i would like to know how to create a sum of all values of nodes labelled ININ.Workgroup_InteractionsAnswered where interval is 'CurrentShift'  

	<Statistics>
				<IcServer name="TEST">
					<ININ.Workgroup>
						<ININ.People.WorkgroupStats_Workgroup name="Adv Order Entry">
							<ININ.Workgroup_NumberAvailableForACDInteractions>7</ININ.Workgroup_NumberAvailableForACDInteractions>
							<ININ.Workgroup_InteractionsWaiting>0</ININ.Workgroup_InteractionsWaiting>
							<ININ.Workgroup_OnInboundACDInteractions>0</ININ.Workgroup_OnInboundACDInteractions>
							<ININ.Queue_Interval name="CurrentPeriod">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="CurrentShift">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousPeriod">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousShift">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
						</ININ.People.WorkgroupStats_Workgroup>
						<ININ.People.WorkgroupStats_Workgroup name="Alle Order Entry">
							<ININ.Workgroup_NumberAvailableForACDInteractions>7</ININ.Workgroup_NumberAvailableForACDInteractions>
							<ININ.Workgroup_InteractionsWaiting>0</ININ.Workgroup_InteractionsWaiting>
							<ININ.Workgroup_OnInboundACDInteractions>0</ININ.Workgroup_OnInboundACDInteractions>
							<ININ.Queue_Interval name="CurrentPeriod">
								<ININ.Workgroup_InteractionsCompleted>3</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="CurrentShift">
								<ININ.Workgroup_InteractionsCompleted>40</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>40</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousPeriod">
								<ININ.Workgroup_InteractionsCompleted>17</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>20</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousShift">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
						</ININ.People.WorkgroupStats_Workgroup>
						<ININ.People.WorkgroupStats_Workgroup name="MW Order Entry">
							<ININ.Workgroup_NumberAvailableForACDInteractions>8</ININ.Workgroup_NumberAvailableForACDInteractions>
							<ININ.Workgroup_InteractionsWaiting>0</ININ.Workgroup_InteractionsWaiting>
							<ININ.Workgroup_OnInboundACDInteractions>3</ININ.Workgroup_OnInboundACDInteractions>
							<ININ.Queue_Interval name="CurrentPeriod">
								<ININ.Workgroup_InteractionsCompleted>4</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>3</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="CurrentShift">
								<ININ.Workgroup_InteractionsCompleted>46</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>49</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousPeriod">
								<ININ.Workgroup_InteractionsCompleted>23</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>25</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousShift">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
						</ININ.People.WorkgroupStats_Workgroup>
						<ININ.People.WorkgroupStats_Workgroup name="NL Order Entry">
							<ININ.Workgroup_NumberAvailableForACDInteractions>7</ININ.Workgroup_NumberAvailableForACDInteractions>
							<ININ.Workgroup_InteractionsWaiting>0</ININ.Workgroup_InteractionsWaiting>
							<ININ.Workgroup_OnInboundACDInteractions>0</ININ.Workgroup_OnInboundACDInteractions>
							<ININ.Queue_Interval name="CurrentPeriod">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="CurrentShift">
								<ININ.Workgroup_InteractionsCompleted>1</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>1</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousPeriod">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
							<ININ.Queue_Interval name="PreviousShift">
								<ININ.Workgroup_InteractionsCompleted>0</ININ.Workgroup_InteractionsCompleted>
								<ININ.Workgroup_InteractionsAnswered>0</ININ.Workgroup_InteractionsAnswered>
							</ININ.Queue_Interval>
						</ININ.People.WorkgroupStats_Workgroup>
						<People.WorkgroupStats_Workgroup name="Pro M Order Entry">
							<Workgroup_NumberAvailableForACDInteractions>7</Workgroup_NumberAvailableForACDInteractions>
							<Workgroup_InteractionsWaiting>0</Workgroup_InteractionsWaiting>
							<Workgroup_OnInboundACDInteractions>0</Workgroup_OnInboundACDInteractions>
							<Queue_Interval name="CurrentPeriod">
								<Workgroup_InteractionsCompleted>0</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>0</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="CurrentShift">
								<Workgroup_InteractionsCompleted>2</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>2</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="PreviousPeriod">
								<Workgroup_InteractionsCompleted>1</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>1</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="PreviousShift">
								<Workgroup_InteractionsCompleted>0</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>0</Workgroup_InteractionsAnswered>
							</Queue_Interval>
						</People.WorkgroupStats_Workgroup>
						<People.WorkgroupStats_Workgroup name="Hwes Order Entry">
							<Workgroup_NumberAvailableForACDInteractions>7</Workgroup_NumberAvailableForACDInteractions>
							<Workgroup_InteractionsWaiting>0</Workgroup_InteractionsWaiting>
							<Workgroup_OnInboundACDInteractions>1</Workgroup_OnInboundACDInteractions>
							<Queue_Interval name="CurrentPeriod">
								<Workgroup_InteractionsCompleted>2</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>2</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="CurrentShift">
								<Workgroup_InteractionsCompleted>56</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>57</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="PreviousPeriod">
								<Workgroup_InteractionsCompleted>32</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>33</Workgroup_InteractionsAnswered>
							</Queue_Interval>
							<Queue_Interval name="PreviousShift">
								<Workgroup_InteractionsCompleted>0</Workgroup_InteractionsCompleted>
								<Workgroup_InteractionsAnswered>0</Workgroup_InteractionsAnswered>
							</Queue_Interval>
						</People.WorkgroupStats_Workgroup>
					</Workgroup>
				</IcServer>
				<PackageName>OrderEntryXML</PackageName>
				<Description></Description>
				<Created>20150119T160407668Z</Created>
				<Message></Message>
				<MessageExpires>20150120T155819Z</MessageExpires>
			</Statistics>

Open in new window

0
Comment
Question by:juliemcnichols
2 Comments
 
LVL 18

Expert Comment

by:zc2
ID: 40558669
This should work:
<xsl:value-of select="sum(//ININ.Workgroup_InteractionsAnswered)"/>
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 40558723
I think you forgot the condition

<xsl:value-of select="sum(//ININ.Queue_Interval[@name="CurrentShift"]/ININ.Workgroup_InteractionsAnswered)"/>
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Problem to Popup 2 81
MS SQL Database Generating XML using query 21 42
Adjust the position 3 60
Excel file not created as expected 7 71
I will show you how to create a ASP.NET Captcha control without using any HTTP HANDELRS or what so ever. you can easily plug it into your web pages. For Example a = 2 + 3 (where 2 and 3 are 2 random numbers) Session("Answer") = 5 then we…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question