Posting Data Islands

Steve Muench SMUENCH at us.oracle.com
Mon Jun 7 16:25:00 BST 1999


I don't quite understand the comment about replacing 
a named temporary buffer for XML sent to me from a server 
by a namespace, but here's an example of posting an 
XML data island to a server: 
 
function postTextAreaXMLToServer() { 
   // Get a new XML Document (these 3 lines not required if 
   // "doc" was already the name of an XML Data Island 
   // in the page). In my example I let the user type in 
   // an XML document in a TEXTAREA on the form whose 
   // name="toSend". doc.loadXML() loads raw text and parses 
   // it as an XML document.  
   var doc = new ActiveXObject("Microsoft.XMLDOM"); 
   doc.async = false; 
   doc.loadXML(toSend.value); 
 
   // Get an instance of the HTTP Request/Response Object 
   var msg = new ActiveXObject("Microsoft.XMLHTTP"); 
 
   // Open an HTTP message to define its characteristics 
   msg.open("POST","http://smuench-lap/echoxml.jsp",false); 
 
   // Send the "doc" XML Document (/Data Island) 
   msg.send(doc); 
 
   // Interpret the response. In this case my server JSP page 
   // parses the sent XML file and sends back the same XML 
   // file as a "text/xml" mimetype (an echo test). 
   toReceive.value = msg.responseXML.documentElement.xml;  
} 
 
See: 
 
http://msdn.microsoft.com/xml/reference/scriptref/XMLHttpRequest_object.asp 
 
For complete details... 
 
_________________________________________________________ 
Steve Muench, Consulting Product Manager & XML Evangelist 
Business Components for Java Dev't Team 
http://www.oracle.com/xml
-------------- next part --------------
An embedded message was scrubbed...
From: "Matthew Sergeant (EML)" <Matthew.Sergeant at eml.ericsson.se>
Subject: RE: Posting Data Islands
Date: 07 Jun 99 02:43:58
Size: 3589
Url: http://mailman.ic.ac.uk/pipermail/xml-dev/attachments/19990607/a81e0731/attachment.eml


More information about the Xml-dev mailing list