the issue is in your For loop, I believe. My reasons are below, as well as my suggestions:
Change your For loop's counting method. You have this:
-
For i = 0 TO (xml.documentElement.childNodes.length - 1)
-
Everytime the loop cycles back, it has to reevaluate the value of xml.documentElement.childNodes.length - 1. Instead of making the processor do that math over and over again, do the following. It's only one computation:
-
dim stopCount
-
stopCount = xml.documentElement.childNodes.length - 1
-
-
For i = 0 to stopCount
-
Second, you have a ReDim statement in your loop. That's really processor intensive because it has to reassign the entire memory space of the array each time you ReDim.
I suggest you use a VBScript dictionary instead.