mizgroup
asked on
XML Parsing Classic ASP
Hi
I'm trying to write a classic ASP script that sends an xml request to an API and parses the response into variables. The send works and the response (.responseText) is the following:
<response status='ok'>
<serviceRequestList>
<serviceRequest>
<customerContactEmail>aaa@ @aaa.com</ customerCo ntactEmail >
<customerName>ABC Corp</customerName>
<description>Misc Job #1</description>
<detailedDescription>Job work</detailedDescription>
<serviceRequestId>4586</se rviceReque stId>
<status>Open</status>
<type>Service</type>
</serviceRequest>
<serviceRequest>
<customerContactEmail>aaa@ @aaa.com</ customerCo ntactEmail >
<customerName>ABC Corp</customerName>
<description>Misc Job #2</description>
<detailedDescription>work on LPTP issues and syncing AD to Google Apps</detailedDescription>
<serviceRequestId>4686</se rviceReque stId>
<status>Open</status>
<type>Service</type>
</serviceRequest>
<serviceRequest>
<customerContactEmail>aaa@ @aaa.com</ customerCo ntactEmail >
<customerName>ABC Corp</customerName>
<description>L2TP Transition and GAPS sync</description>
<detailedDescription>wJob work</detailedDescription>
<serviceRequestId>4587</se rviceReque stId>
<status>Open</status>
<type>Service</type>
</serviceRequest>
</serviceRequestList>
</response>
However when trying to parse the result I'm unable to get the information I need. From the above response I'd like to extract the customerContactEmail, customerName, description, detailedDescription, serviceRequestId, status, type tags into individual variables.
Ive tried many different methods, but I'm getting blank returns with no errors from everything I've tried.
Can someone please help!
Thanks
I'm trying to write a classic ASP script that sends an xml request to an API and parses the response into variables. The send works and the response (.responseText) is the following:
<response status='ok'>
<serviceRequestList>
<serviceRequest>
<customerContactEmail>aaa@
<customerName>ABC Corp</customerName>
<description>Misc Job #1</description>
<detailedDescription>Job work</detailedDescription>
<serviceRequestId>4586</se
<status>Open</status>
<type>Service</type>
</serviceRequest>
<serviceRequest>
<customerContactEmail>aaa@
<customerName>ABC Corp</customerName>
<description>Misc Job #2</description>
<detailedDescription>work on LPTP issues and syncing AD to Google Apps</detailedDescription>
<serviceRequestId>4686</se
<status>Open</status>
<type>Service</type>
</serviceRequest>
<serviceRequest>
<customerContactEmail>aaa@
<customerName>ABC Corp</customerName>
<description>L2TP Transition and GAPS sync</description>
<detailedDescription>wJob work</detailedDescription>
<serviceRequestId>4587</se
<status>Open</status>
<type>Service</type>
</serviceRequest>
</serviceRequestList>
</response>
However when trying to parse the result I'm unable to get the information I need. From the above response I'd like to extract the customerContactEmail, customerName, description, detailedDescription, serviceRequestId, status, type tags into individual variables.
Ive tried many different methods, but I'm getting blank returns with no errors from everything I've tried.
Can someone please help!
Thanks
ASKER
@Big Monty thanks.. but i get the following error
oft VBScript runtime error '800a01a8'
Object required: 'objXMLDoc.documentElement '
oft VBScript runtime error '800a01a8'
Object required: 'objXMLDoc.documentElement
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you very much, ive been breaking my head on this for two days!
glad to help :)
Open in new window