Noob msxml/asp question

admin

Administrator
Staff member
I'm using a script to query ups for tracking information. I'm trying to get another node but can't seem to figure it out. Was wondering if someone with a little more experience could take a look at it for me :)

This is a sample of the xml response I'm parsing
<!-- m --><a class="postlink" href="http://www.3sx.com/temp/xmlresponse.htm">http://www.3sx.com/temp/xmlresponse.htm</a><!-- m -->

I'm trying to get the node TrackResponse/Shipment/ScheduledDeliveryDate to an asp variable, in addition to what I'm already getting

Any help would be greatly appreciated :)

Here's the asp

set xmlhttp = server.Createobject("Microsoft.XMLHTTP")
"POST","https://wwwcie.ups.com/ups.app/xml/Rate",false
xmlhttp.Open "POST","https://www.ups.com/ups.app/xml/Track",false
xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
xmlhttp.send DataToSend
strRetval=xmlhttp.responseText
'response.write strRetval &"<br><br>"
set xmlhttp=nothing

set wobjXMLDoc = CreateObject("MSXML.DOMDocument")
wobjXMLDoc.async = False
wvarResult = wobjXMLDoc.loadXML(strRetval)
%>
<table width="600" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#666666">
<tr bgcolor="#FFFFFF">
<td width="185" height="22">Location</td>
<td width="215">Status</td>
<td>Date</td>
<td>Time</td>
</tr>
<%
on error resume next
for each child in wobjXMLDoc.selectNodes("TrackResponse/Shipment/Package/Activity")
pDate=trim((child.selectSingleNode("Date").text))
pYear = Left(pDate, 4)
pMonth=Mid(pDate,5,2)
pDay = Right(pDate, 2)

pTime=trim((child.selectSingleNode("Time").text))
pHour=Left(pTime,2)
pMinute=Mid(pDate,3,2)
pSecond=Right(pDate,2)
%>

<tr bgcolor="#FFFF99">
<td><%response.write(child.selectSingleNode("ActivityLocation/Address/City").text)%>&nbsp;<%response.write(child.selectSingleNode("ActivityLocation/Address/StateProvinceCode").text)%></td>
<td><%response.write(child.selectSingleNode("Status/StatusType/Description").text)%></td>
<td><%=pMonth%>/<%=pDay%>/<%=pYear%></td>
<td><%=pHour%>:<%=pMinute%>:<%=pSecond%></td>
</tr>



<%next%>
</table>
</p>
<%set wobjXMLDoc=nothing%>


Thanks!
-Andrew
 
Back
Top