0 Replies Latest reply on Feb 17, 2012 11:20 AM by BigGunN

    finding the UBound of xml doc

    BigGunN Level 1

      So I finally figured out how to use XPath with VBScript to loop through an XML document.  The issue I am having now is figuring out the UBound limit to tell the loop when to end.

       

      Here is where I currently am..

       

           Set myRoot = myDocument.XMLElements(1)

           Set myChild = myRoot.evaluateXPathExpression("//name")

       

           for i = 1 to UBound(myChild)

                AddNewPage myDocument, myChild(i)

           Next

       

      When I use this I get a "Arrgument not optional" error on the line with the UBound

       

      If I use...

          for i = 1 to 4

       

      it works, but there should be a way to figure out the upperbound without having to set it explicitly.

       

      Does anyone know the proper syntax to use with this?