Consider this problem:
Using Javascript/E4X, in a non-browser usage scenario (a Javascript HL7 integration engine), there is a variable holding an XML snippet that could have multiple repeating nodes.
<pets>
<pet type="dog">Barney</pet>
<pet type="cat">Socks</pet>
</pets>
Question: How to get the count of the number of pet nodes in Javascript/E4X ?
EDIT: To clarify, this question should be around E4X (ECMAScript for XML). Apologies to those who answered without this information. I should have researched & posted this info beforehand.