Solved

XSL sum help

Posted on 2015-01-19
2
159 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

688 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