Solved

XSLT COUNT FUNCTION

Posted on 2010-11-16
4
418 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
  • 2
  • 2
4 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 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

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

820 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