je la fonction classique ASP suivant:Ne comprennent pas « objet requis » erreur
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
L'exécution de ce sur un noeud XML (provenant d'un objet Microsoft.XMLDOM), je reçois l'erreur Object required: 'parent'
sur la ligne
path = parent.nodeName & "/" & path
et je ne peux pas comprendre pourquoi. Je vérifie isobject
. Quelqu'un peut-il expliquer ce que l'exécution se plaint, et pourquoi?