developers

    Forum Stats

  • 3,873,884 Users
  • 2,266,627 Discussions
  • 7,911,651 Comments

Discussions

Count the maximum number of elements for a particular node

user4531996
user4531996 Member Posts: 37
edited May 29, 2013 9:16AM in XQuery
Having this XML file:
<gifts>
<giftinfo gifter="SANTA CLAUS">
<Recipients>
<kid name="JOHN GOODBOY" />
<kid name="CLARK GETCOAL" />
</Recipients>
</giftinfo>
<giftinfo gifter="TOOTH FAIRY">
<Recipients>
<kid name="PAUL TOOTHLESS" />
</Recipients>
</giftinfo>
<giftinfo gifter="THREE WISE MEN">
<Recipients>
<kid name="TONNY CAMEL" />
<kid name="VICTOR HORSERIDER" />
<kid name="CHARLES DELEPHANT" />
</Recipients>
</giftinfo>
<giftinfo gifter="EASTER BUNNY">
<Recipients>
<kid name="JIMMY EGGHEAD" />
</Recipients>
</giftinfo>
</gifts>

I need to find what is the maximum number of "kid name"s under "giftinfo gifter".
For the example above, I would like to see "3".
Any hints would be appreciated.
Tagged:

Answers

This discussion has been closed.
developers