Click to See Complete Forum and Search --> : XML Exchange and WebDav!


Funkymonkey
10-28-2005, 10:39 AM
I am using WebDav to access some e-mails via exchange. I am sending exchange some search criteria and am getting an xml document sent back with the results. The problem is that I'm not sure how to display this returned xml docuent.

Here's where I send the request for the data:
...
Sub getMessages_OnClick()
strUsername = document.all.mailbox.value
If strUsername <> "" Then
strInboxURL = strProtocol & "://" & strServername & "/Exchange/"
strInboxURL = strInboxURL & strUsername & "/" & strInbox
Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.Open "SEARCH", strInboxURL, True
objXMLHTTP.setRequestHeader "Content-type:", "text/xml"
objXMLHTTP.setRequestHeader "Depth", "1"
objXMLHTTP.onReadyStateChange = getRef("checkXMLHTTPState")
strXML = "<?xml version='1.0' ?>" & _
"<a:searchrequest xmlns:a='DAV:'><a:sql>" & _
"SELECT" & _
" ""DAV:href""" & _
",""urn:schemas:httpmail:subject""" & _
",""urn:schemas:httpmail:from""" & _
" FROM scope('shallow traversal of """ & strInboxURL & """')" & _
" WHERE ""DAV:ishidden""=False" & _
" AND ""DAV:isfolder""=False" & _
"</a:sql></a:searchrequest>"
objXMLHTTP.SetRequestHeader "Range", "rows=0-50"
objXMLHTTP.Send(strXML)
End If
End Sub

Sub checkXMLHTTPState
If objXMLHTTP.readyState = 4 Then
responseStatus.innerHTML = objXMLHTTP.Status & " - " & objXMLHTTP.StatusText
Set objXMLDoc = objXMLHTTP.ResponseXML

XSLDiv.innerHTML = objXMLDoc
'.TransformNode(responseXSL.documentElement)
Set objXMLHTTP = Nothing
Set objXMLDoc = Nothing
End If
End Sub

At the moment, the returned xml is transformed into html via xsl but I don't know how to intercept so that I can display just the xml itself???

Thank you loads!!!!!!!11