For some reason I cannot make this work. I have the following XML with 2 registration nodes. All I need is to return a <serialnumber> (which the script currently does) as variable value and all <id>, <qty> for this <serialnumber>.
I can get as far as the "serial number' (see the code below) but cannot seem to get the loop for the individual <module> working in order to get all <id>, <qty>. I am getting the Object doesn't support this property or method: 'ModuleList.length' response.
===================== XML ================
<root>
<registration>
<name>For Test</name>
<serialnumber>1234567890</serialnumber>
<modules>
<module>
<name>SERVER : A</name>
<id>15</id>
<qty>1</qty>
</module>
<module>
<name>SERVER : B</name>
<id>40</id>
<qty>1</qty>
</module>
</modules>
</registration>
<registration>
<name>For Test</name>
<serialnumber>0987654321</serialnumber>
<modules>
<module>
<name>SERVER : 1</name>
<id>15</id>
<qty>1</qty>
</module>
<module>
<name>SERVER : 2</name>
<id>40</id>
<qty>1</qty>
</module>
<module>
<name>SERVER : 3</name>
<id>15</id>
<qty>1</qty>
</module>
<module>
<name>SERVER : 4</name>
<id>40</id>
<qty>1</qty>
</module>
</modules>
</registration>
</root>
===================== VB Script ================
Set objXML = Server.CreateObject("Msxml2.DOMDocument")
objXML.LoadXml(xmlString)
Set Root = objXML.documentElement
Set registrationList = Root.getElementsByTagName("registration")
For i = 0 to registrationList.length -1
Set serialnumber = objXML.getElementsByTagName("serialnumber")(i)
Set ModuleList = Root.getElementsByTagName("modules")(i)
For x = 0 to ModuleList.length -1
Set module = objXML.getElementsByTagName("module")(x)
Response.Write module.text ' this is where I was expecting to stuff the array
Next
Response.Write serialnumber.text & " "
Next
Set objXML = Nothing