[Home] [By Thread] [By Date] [Recent Entries]
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
|

Cart



