Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing incoming XML

Status
Not open for further replies.

wbodger

Programmer
Apr 23, 2007
769
US
So, I have not really worked with XML files before and now I have to be able to integrate them into an order entry system. What I would like to do is grab the incoming XML, parse it out and place the values into the proper variables for use throughout the page. But I have not really been able to find the info to help me do that in a classic ASP environment. So, anybody out there got any pointers/tips or great tutorials for me?

Thanks,
Willie
 
Anyone?

I have something more concrete. Here is my ASP file
Code:
<%@ Language=VBScript %>
<%
Dim myDoc  
  
set myDoc = Server.CreateObject("Microsoft.XMLDOM")  
  
myDoc.async=false  
  
myDoc.load(request)  

address = Trim(cStr("" &  myDoc.getElementsByTagName("cbt:Street1")(0).childNodes(0).nodeValue))
city = Trim(cStr("" &  myDoc.getElementsByTagName("cbt:City")(0).childNodes(0).nodeValue))  
postalcode = Trim(cStr("" &  myDoc.getElementsByTagName("cbt:PostalCode")(0).childNodes(0).nodeValue)) 

%>

And here is my error
Code:
# Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'getElementsByTagName(...)(...)'
/mysupport/register/cbtest.asp, line 11

Where line 11 is
Code:
address = Trim(cStr("" &  myDoc.getElementsByTagName("cbt:Street1")(0).childNodes(0).nodeValue))

Doesn't
Code:
set myDoc = Server.CreateObject("Microsoft.XMLDOM")

create the object that I need?

wb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top