I have the following ASP classic function:
function get_children(n)
dim local_array
dim parent
dim path
if n.hasChildNodes() then
for each child in n.childNodes
local_array = array_merge(local_array, get_children(child))
next
else
set parent = n.parentNode
while isobject(parent)
path = parent.nodeName & "/" & path
set parent = parent.parentNode
wend
path = path & "/" & get_attr(n, "file")
set_attr n, "path", path
local_array = Array(0)
set local_array(0) = n
end if
get_children = local_array
end function
Running this over an XML node (coming from a Microsoft.XMLDOM object), I get the error Object required: 'parent'
on the line
path = parent.nodeName & "/" & path
and I can't understand why. I'm checking isobject
. Can anyone explain what the runtime is complaining about, and why?