?
Solved

XSLT COUNT FUNCTION

Posted on 2010-11-16
4
Medium Priority
?
421 Views
Last Modified: 2012-05-10
I can successfully count all incomingAnswered calls from it's immediate ancestor, in this case extension id="10002".

What I want to do is count from a higher level, in this case <site id="2" name="Tech Support">.

So basically irrespective of how high in the hierarchy I am I want to be able to count all incomingAnswered calls for all children.

Can anyone please advise.

Thank you.
HERE IS XML CODE EXAMPLE:

<?xml version="1.0" encoding="utf-8"?>
<overviewData>
  <items id="0">
    <region id="1" name="New Items">
      <site id="2" name="Tech Support">
        <extension id="10002" name="2361" extensionNumber="2361">
          <incomingAnswered id="1">
            <cdrRecord startDate="23/12/2004" startTime="11:12:00" cli="01229763522" destination="2361" sourceLocation="Millom" duration="03:06:20" cost="0" />
            <cdrRecord startDate="23/12/2004" startTime="11:12:00" cli="09830371093" destination="2361" sourceLocation="Premium Rate" duration="03:06:20" cost="0" />
            <cdrRecord startDate="23/12/2004" startTime="11:12:00" cli="01233763522" destination="2361" sourceLocation="Ashford" duration="03:06:20" cost="0" />
            <cdrRecord startDate="23/12/2004" startTime="11:12:00" cli="118600" destination="2361" sourceLocation="UNAVAILABLE" duration="03:06:20" cost="0" />
            <cdrRecord startDate="23/12/2004" startTime="11:12:00" cli="01612272811" destination="2361" sourceLocation="Manchester" duration="03:06:20" cost="0" />
          </incomingAnswered>
          <outgoingAnswered id="2">
            <cdrRecord startDate="23/12/2004" startTime="15:12:00" destination="O2" dialledNumber="07594702887" duration="00:06:20" cost="0.82" />
          </outgoingAnswered>
        </extension>
      </site>
   </region>
  </items>
</overviewData>

HERE IS XSL COUNT FUNCTION:

<xsl:value-of select="count(incomingAnswered/cdrRecord)"></xsl:value-of>

Open in new window

0
Comment
Question by:gillsboy123
[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
  • 2
4 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 2000 total points
ID: 34144237
count(.//incomingAnswered) will do that
0
 

Author Comment

by:gillsboy123
ID: 34144319
Thank you. It worked really weel
0
 

Author Closing Comment

by:gillsboy123
ID: 34144324
Cheers.
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 34148624
welcome
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

764 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