Object Required Error In Xml
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Don't understand “Object required” error up vote 2 down vote favorite 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? xml asp-classic parent-child parent share|improve this question asked Oct 25 '10 at 17:42 Chris Tonkinson 5,89293372 add a comment| 2 Answers 2 active oldest votes up vote 2 down vote accepted When there is no more parent nodes, you will get a null value back, i.e. Nothing. However, Nothing is the "null object", so it's also an object. The value of IsObject(Nothing) is True. Check for Nothing instead of checking if the variable contains an object: while not (parent is Nothing) share|improve this answer answered Oct 25 '10 at 18:00 Guffa 447k58418733 add a comment| up vote 0 down vote I'm not 100% sure, but maybe you should use something with/instead if IsObject? I suggest to try IsEmpty(), IsNull() or Is Nothing. The latter is used like this: If Not (myObject Is Nothing) share|improve this answer answered Oct 25 '10 at 17:52 Andrew Bezzub 10.8k12856 add a
Unanswered Topics Wrox Programmer Forums > XML > XML Object Required Error When Using MSXML2?!?! User Name Remember Me? Password Reminder Password Register Register | FAQ | Members List | Calendar | Today's Posts | Search XML General XML discussions. Search Forums Show Threads Show Posts Advanced Search Find All Thanked Posts Go to Page... Welcome to the p2p.wrox.com Forums. You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you http://stackoverflow.com/questions/4017310/dont-understand-object-required-error can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free . Page 1 of 2 1 2 > Thread Tools Display Modes #1 (permalink) January 5th, 2007, 11:33 AM kevorkian Authorized User Join Date: Sep 2004 Location: , , . Posts: 62 Thanks: 0 Thanked 1 Time in 1 Post http://p2p.wrox.com/xml/52308-object-required-error-when-using-msxml2.html Object Required Error When Using MSXML2?!?! Ok, I am somewhat new to this object and am totally confused at this point, any help would be wonderful! I am using VBScript and ASP to attempt to parse an xml packet that was posted to my site from a number of various domains. The post from the other sites look like this: xmlDoc = "" & _ "
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help https://www.experts-exchange.com/questions/23354618/Object-Required-Error-using-Microsoft-XMLDOM-to-read-XML-Data-Feed-with-ASP-VBScript.html Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Expand Search Submit Close Search Login Join Today Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > Object Required Error using Microsoft.XMLDOM to read XML Data Feed with ASP VBScript object required Want to Advertise Here? Solved Object Required Error using Microsoft.XMLDOM to read XML Data Feed with ASP VBScript Posted on 2008-04-25 ASP XML 1 Verified Solution 8 Comments 2,916 Views Last Modified: 2008-04-25 I wrote a script to read and format an XML feed. I was working great for a while. I am not sure object required error what changed, but now I am getting an error: Object required: 'XMLRoot' /NBAStandingsTemp.asp, line 16 Unfortunately the code is not getting very far. Here is the code where it is getting stuck: Set objXML = Server.CreateObject("Microsoft.XMLDOM") objXML.Async = False objXML.SetProperty "ServerHTTPRequest", True objXML.ResolveExternals = True objXML.ValidateOnParse = True objXML.Load(TheFeed) Set XMLRoot = objXML.documentElement Set StandingTag = XMLRoot.getElementsByTagName("standing") The above line is line 16. The running example (well not really running) is here: http://www.sorenwinslow.com/NBAStandingsTemp.asp Here is where you can see my complete code: http://www.sorenwinslow.com/NBAStandingsTemp.txt Here is the data feed: http://erikberg.com/nba/standings.xml 0 Question by:swinslow Facebook Twitter LinkedIn Google LVL 82 Active 7 days ago Best Solution byhielo >>Well that one definitley doesnt/wont work. It isnt an object that will read XML Dom. Yes, it is used to grab, read and/or import data from other websites but it is not made to process XML, that is what Go to Solution 8 Comments LVL 82 Overall: Level 82 ASP 28 XML 14 Message Active 7 days a