XPath count() function

Suppose I have an XML tree as below:

proceedings
   -name
   -contents
      -article
         -author
         -title
         -pages

How can I identify any title that has only one author? And the number of articles that have more than three author using xpath?

Answers


Title with one author:

/proceedings/contents/article[count(author)=1]/title

Number of articles with more than three authors:

count(/proceedings/contents/article[count(author)>3])

Need Your Help

How to make a JList filling JPanel

java swing jpanel layout-manager jlist

I have got a JPanel with a JList added inside. How to make that that JList will got height and weight like my JPanel. It need to fill it totaly.

Yet unknown variables inside array

php

Is there a way to add some kind of parameters to array (yet unknown variables)? As you can see here, i dont know the userID in advance (before the mysql fetch), so i cant properly form a link leadi...