Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

XSL sum help

Posted on 2015-01-19
2
Medium Priority
?
174 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 19

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 2000 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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 …
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
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 basics of jQuery including how to code hide show and toggles. 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…

618 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