![]() Capt. Horatio T.P. Webb | Creating XML on the Client Parks -- FALL 2000 Last Updated 12PM 9/11/2000 |
To send XML from the client to the server, we can employ the XMLHTTP component of IE5. The following six lines of VBScript code can be used to send xml:
1 | Set xmlsend = CreateObject("Microsoft.XMLHTTP") |
this xmlsend object will be used to send the XML using XMLHTTP |
2 | xmlsend.open "GET", "http://disc-nt.../echoxml.asp", False |
this open command establishes three parameters:
|
3 | xmlsend.setRequestHeader "Content-type", "text/xml" |
Sets the request content-type to xml |
4 | xmldata="a string respresenting the xml data" |
the xml data is loaded into an arbitrary string |
5 | xmlsend.send xmldata |
sends the xml |
6 | xmlresponse = xmlsend.responseText |
receives the result of the server's response |
Note that the server-side program must be able to receive the XML file.