count in xpath

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

<!-- head comments -->
    <!-- second level comments -->
    <person ssn="s111222333"  gender="F"  luckynumber="6" >   
        <link spouse="s123456789"  children="s123123123 s222333444" ></link>  
    <person ssn="s123123123"  gender="M"  luckynumber="4" >
        <link father="s123456789"  mother="s111222333"  luckynumber="10" ></link>
     <person ssn="s555987323"  gender="M" >
        <link spouse="s887667545"  children="s123456789" ></link>
Question by:sumantedla
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

dualsoul earned 150 total points
ID: 13704375
this one, i guess :  count(/familytree/person[link/@spouse])

Featured Post


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