Solved

XSLT COUNT FUNCTION

Posted on 2010-11-16
4
407 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
"In order to have an organized way for empathy mapping, we rely on a psychological model and trying to model it in a simple way, so we will split the board to three section for each persona and a scenario and try to see what those personas would Do,…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now