Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Object doesn't support this property or method??

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,66117
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Object doesn't support this property or method??
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Object doesn't support this property or method?? - 11/7/2008 11:14:54 PM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
I'm trying to enumerate text between XML tags, but not succeeding...


      

It gives me an error here....
Set objNode = xmlDoc.getElementsByTagName("photodumpalign").nodeValue

"Object doesn't support this property or method. xmlDoc.getElementsByTagName(...).nodeValue"
 
 
Post #: 1
 
 RE: Object doesn't support this property or method?? - 11/8/2008 1:58:53 AM   
  ehvbs

 

Posts: 2224
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi TKS,

.getElementsByTagName returns a collection, not a node with (possibly) a
.nodeValue. See


      

output:


      

Compare your and my code carefully and consult the VBScript resp. XML Docs.

Good luck!

ehvbs

(in reply to TKS)
 
 
Post #: 2
 
 RE: Object doesn't support this property or method?? - 11/8/2008 4:41:53 AM   
  TNO


Posts: 1402
Score: 16
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
A couple nitpicks first for future reference:

This is an old COM object, and may not be supported in the near future. (I don't think there is even a Type Library in Windows Vista any more for this). So, replace this:

CreateObject("Microsoft.XMLDOM")

with this:

CreateObject("MSXML2.DomDocument.3.0")

this version is cross compatible across all current windows versions and expected in the next version.

You don't need to write literal tags to a file either, you can do it in memory with the DOM. Take a look at this:
http://www.w3schools.com/dom/default.asp

also, use UTF-8 as the encoding

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to ehvbs)
 
 
Post #: 3
 
 RE: Object doesn't support this property or method?? - 11/9/2008 2:24:35 AM   
  TKS


Posts: 187
Score: 0
Joined: 5/16/2008
Status: offline
@ ehvbs -- Took me some time to understand whats going on in your code, but I think I got it down pat now. Thanks!
@ TNO -- Done and bookmarked. Thanks!

(in reply to ehvbs)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Object doesn't support this property or method?? Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts