Export (0) Print
Expand All

Sending XML Between the Client and Server

When sending XML to the client, you must first create a textual version of the XML.

To create the textual version, you can use the xml property of the root node of the XML document, as shown in the following JScript fragment.

Response.Write(xObj.xml);

You can also use the technique described in Getting the XML Data.

After you have the XML text string, you can use one of the following approaches to send it to the client in response to a client request.

  • Maintain the XML as a file on the server. The client can load this file directly using the load method, as shown in the following JScript code.

    xObj.load("http://www.microsoft.com/sample.xml");
    
  • Create and return the XML from an Active Server Pages (ASP) page. The client can load the result using the load method, as shown in the following Jscript code.

    xObj.load("http://www.microsoft.com/sample.asp");
    
    
  • Create and return XML information in response to a request from the XMLHTTP control.

You can send XML to the server using any standard technique for sending information to the server.

  • Post information from a form.

  • Post information from a form in a hidden frame.

  • Use the XMLHTTP control to send and receive XML information using HTTP requests.

For more information about posting data, see the DHTML documentation.

Show:
© 2014 Microsoft