Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

count in xpath

Posted on 2005-04-04
1
Medium Priority
?
867 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
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

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

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

Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Create a Windows 10 custom Image with custom task bar and custom start menu using XML for deployment.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month13 days, 13 hours left to enroll

580 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