I want to use xpath to count occurances of certain node in xml document. What would I use? For ex: If I wanted to get second occurance of movie node I’d use movie[2].
How do I get total number of movie node occurances in document?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use the
countfunction.For your case, use this XPath expression: