From: vunet on
Hello,
I am not able to load XML using Load method from child directory
(unlikely security issue). The function below sets xmlObj object once
and reuses this object every time it is accessed to loop through some
nodes. However, if I run this function from child directory, xmlObj
object contains no nodes even though it exists and loads XML without
errorCode. I achieved success if I set a new object (with new name)
but this would add complexity to my app and I want consistency to
reuse one object cross whole app. Please tell me what can be done in
my case and why xmlObj does not have children from child directory.


set xmlObj = nothing
function setAppXML ()
setAppXML = true 'default
if xmlObj is nothing then
Set xmlObj = Server.CreateObject("Microsoft.XMLDOM")
xmlObj .async = False
setAppXML = xmlObj.Load (Server.MapPath(PageDepth&"db/
appdata.inc"))
if xmlObj.parseError.errorCode > 0 then
setAppXML = false
resonse.write "Error parsing XML: "&xmlObj.parseError.errorCode
end if
end if
end function


''''''somewhere later I do
If setAppXML = true Then Set objConfig =
xmlObj.getElementsByTagName("config")
'BUT if I run function from any child directory then
objConfig.item(0).childNodes has NO NODES