request.open("GET", "some-file-on-the-server.xml", true);
In my case i was using it to process an XML file containing data for google maps, the XML document is in the following format:
<agents lat="" lng="" company_name="" individual_name="" additional_info="" phone="" mobile_phone="" fax="" email="" url="" />
As outlined in the summary what I needed to do was this:
request.open("GET", "http://www.some-site.tld/some-file-on-the-server.xml", true);
Currently only firefox (>3.5) supports this kind of thing with minor changes in XML and code, but since I had to maintain browser support for the big 5 I couldn't use this method.
What I decided to do was keep one XML document on one server then use PHP to handle the rest on all other servers, lets say our XML document is at http://www.max.com/document.xml, for each site i would like that to be available I used the following.
request.open("GET", "cross_site_xml_engine.php", true);
cross_site_xml_engine.php - code:
header("Cache-Control: no-cache, must-revalidate");
echo "<!--Cross site XML Engine: Written by MaxMouse\nThe below contents exist at http://www.max.com/document.xml\n-->\n";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec ($ch);