All Forums >> [Scripting] >> ASP >> problems getting nodes from XML Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
im having the toughest time getting my selectSingleNode function to work. It doesnt want to select anything. I keep getting this error : Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: '[object]' /VBSportal/welcome.asp, line 66
The red line is the one that is failing. what am i doing wrong.
This is my xml : the blue tag is what I want to select so that I can create a select box of all the DIV items. <DSIOUT> <DATE>04-19-2007 15:14:31</DATE> <XMLVERSION>1.0</XMLVERSION> <XMLENCODING>UTF-8</XMLENCODING> <DATA> <DIVS> <DIV>P-PACCAR</DIV> <DIV>B-MERCEDES</DIV> <DIV>F-FREIGHTLINER</DIV> <DIV>M-MACK</DIV> <DIV>C-CUMMINS</DIV> <DIV>D-DETROIT</DIV> </DIVS> </DATA> </DSIOUT>
I think this is an encoding issue. Im getting my XML from a web service. i took the code from the web service and pasted it directly into the script and it works. however when the exact same code is returned from the web service it doesnt work. can this be an encoding issue?
I think I tried that. I really think its an encoding issue. I could be wrong but the reason that I think this is because if I copy the xml as a static string into the program it works fine. but when the web service returns this I cant select anything.
Error Type: Microsoft VBScript runtime (0x800A01A8) Object required: 'divXML.selectsinglenode(...)' /VBSportal/functions.asp, line 33
note:
i had the program response.write() out the output that I recieve from the web service without doing the LoadXML(). this is what is returned from the web service: <?xml version="1.0" encoding="utf-8"?> <string xmlns="<DIVS><DV>P-PACCAR</DV><DV>B-MERCEDES</DV><DV>F-FREIGHTLINER</DV><DV>M-MACK</DV><DV>C-CUMMINS</DV><DV>D-DETROIT</DV><DV>K-CATERPILLAR</DV><DV>W-VOLVO/GM</DV><DV>X-MISCELLANEOUS</DV><DV>R-REBUILT</DV><DV>H-HARDWARE</DV><DV>O-GAS'>http://localhost/DSWebService/WebService"><DIVS><DV>P-PACCAR</DV><DV>B-MERCEDES</DV><DV>F-FREIGHTLINER</DV><DV>M-MACK</DV><DV>C-CUMMINS</DV><DV>D-DETROIT</DV><DV>K-CATERPILLAR</DV><DV>W-VOLVO/GM</DV><DV>X-MISCELLANEOUS</DV><DV>R-REBUILT</DV><DV>H-HARDWARE</DV><DV>O-GAS, OIL AND GREASE</DV><DV>Y-YAMAHA</DV><DV>S-DIRECT SHIP PACCAR</DV><DV>N-NISSAN</DV><DV>I-INTERNATIONAL</DV><DV>V-VOLVO</DV><DV>Z-ZEBRA</DV><DV>U-ISUZU</DV><DV>a-stuff</DV></DIVS></string>
Update: I just realized that I should tell you that I made a change to the xml. notice that the DIV tags are now DV. a co worker pointed out that DIV is already a used tag so I changed it.
< Message edited by kelphis -- 4/23/2007 12:24:04 AM >