Reading a null value using MSXML2.ServerXMLHTTP
Hi! I'm trying to read from an xml file and then copy the values to an array. However, I only want to copy the nodes with values. Those with null should not be copied anymore. I came up with this code. But this still includes the null values. The IF statement seems to be not working. Can someone please help me? Thanks!
Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")
url = "http://httpsomething/" & filename
xml.Open "GET", url, False
xml.Send
Set NodeList = xml.responseXml.selectNodes(nodename)
For Each objChild In NodeList
if objChild.hasChildNodes() then
dim i, flag, total
total=0
i=0
flag=0
do while (total<objChild.childNodes.length and flag=0)
if objChild.childNodes(i).text="" then
flag=1
end if
total=total+1
loop
flag=0
response.write "total: "&total
redim arr(total)
do while (i<total)
arr(i)=objChild.childNodes(i).text
i=i+1
loop
end if
next
|