2 Replies Latest reply: May 29, 2013 8:16 AM by user11141835 RSS

    Count the maximum number of elements for a particular node

    user4531996
      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.