How to count XML nodes (QTP, VBScript)
Parent page: Service Functions – XML (QTP, VBScript)
Answers
1. How to count all direct children?
Set objColl = objParent.ChildElements() intCount = objColl.Count
2. How to count all direct children, specific name tag?
Set objColl = objParent.ChildElementsByPath("./wanted") intCount = objColl.Count
3. How to count all descendants?
Set objColl = objParent.ChildElementsByPath("descendant::*") intCount = objColl.Count