Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Setting XML Object and Reusing It From Different Directories

Thread Tools

Setting XML Object and Reusing It From Different Directories

Posts: n/a
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/"))
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 =
'BUT if I run function from any child directory then
objConfig.item(0).childNodes has NO NODES
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Virtual Directories and Physical directories Paul M Fin MCAD 4 06-27-2008 07:50 PM
How to use different asmx in different sub-directories ? Sophie PARISOT ASP .Net Web Services 1 02-13-2006 03:52 AM
Reusing XML Processing Code in non-XML Applications Oleg Paraschenko XML 0 06-06-2005 09:18 PM
Extracting Directories and Sub Directories and Counting Ron Smith Perl Misc 5 11-02-2004 11:23 PM
Getting all directories/files from current directory and using -d flag for the directories Adam Petrie Perl Misc 8 10-11-2004 01:28 PM