?
Solved

count in xpath

Posted on 2005-04-04
1
Medium Priority
?
859 Views
Last Modified: 2012-08-14
Hi,
I am beginner in xpath. a simple question...
How to get the count of persons who have a spouse.

<?version="1.0"?>
<!-- head comments -->
<familytree>
    <!-- second level comments -->
   <meta>Becker</meta>
   
    <person ssn="s111222333"  gender="F"  luckynumber="6" >   
        <first>Valerie</first>
        <last>Becker</last>
        <email>valerie@hotmail.com</email>
        <link spouse="s123456789"  children="s123123123 s222333444" ></link>  
    </person>
    <person ssn="s123123123"  gender="M"  luckynumber="4" >
        <first>Chris</first>
        <last>Becker</last>
        <email>chris@becker.com</email>
        <link father="s123456789"  mother="s111222333"  luckynumber="10" ></link>
    </person>
     <person ssn="s555987323"  gender="M" >
        <first>John</first>
        <last>Becker</last>
        <email>john@becker.com</email>
        <link spouse="s887667545"  children="s123456789" ></link>
    </person>
</familytree>
0
Comment
Question by:sumantedla
[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
1 Comment
 
LVL 15

Accepted Solution

by:
dualsoul earned 150 total points
ID: 13704375
this one, i guess :  count(/familytree/person[link/@spouse])
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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

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