Hello, I have a programming doubt... I think this can apply to every language, imagine this scenario where I have this xml:
<MediaFiles>
<MediaFile>
<![CDATA[VIDEO]]>
</MediaFile>
<MediaFile>
<![CDATA[VIDEO]]>
</MediaFile>
<MediaFile>
<![CDATA[VIDEO]]>
</MediaFile>
<MediaFile>
<![CDATA[VIDEO]]>
</MediaFile>
<MediaFile>
<![CDATA[VIDEO]]>
</MediaFile>
</MediaFiles>
How can I count the number of occurences of <MediaFile> so I can make a group of every mediafile and do a Random to select one of them?
Pseudo-code of what I want:
foreach(<mediafile> of <mediafiles>)
array[] = mediafile VIDEO;