I am having a problem resolving the oList object with my CreateObject("System.Collections.ArrayList")
The error I get in vbscript
"Microsoft VBScript runtime error: Object doesn't support this property or method: 'list.Add'"
Based on this tutorial I know you can use COM wrapped .Net components in vbscript; so why won't this work?
Additional information:
When I am debugging in VS08 and add a watch to list, it says Children could not be evaluated.
The watch for objNode.value
has a two character string value. (Which is expected behavior)
Function ProcessXML(oXML)
STOP
xPathExemptions= "//Exemption/@ExemptCodeWord"
Dim xmlDoc : Set xmlDoc = CreateObject("MSXML2.DOMDocument.6.0")
xmlDoc.Async = False
xmlDoc.loadXML(oXML)
Dim colNodes
Set colNodes = xmlDoc.selectNodes(xPathExemptions)
Dim oList
Set oList = CreateObject("System.Collections.ArrayList")
Dim objNode
For Each objNode in colNodes
oList.Add = objNode.value
Next
'ProcessExemptions = CStr(xmlDoc.selectNodes(xPathExemptions))
End Function
If you have any comments on my vbscript; please let me know - just started learning and don't know best practices.