To import XML into the system, open the application and click ‘External’.

You can now see the ‘Load external MIDAS XML’ textbox. Paste in a URL of an XML file that uses MIDAS, such as:
http://heritage-standards.org/midas/examples/monument_example.xml
The Javascript function then sends the request to a proxy on the server to handle the request. This ensures that cross-domain XMLHTTP requests can be done via Javascript. The XML is then parsed and data is loaded onto the interface.
Once we have the data in the XMLHTTP response object we need to parse the data.
In Javscript we load the parser depending on the client:
var dom;
if(oBrowser == "FF") {
var parser = new DOMParser();
dom = parser.parseFromString(XmlRequest.responseText, "text/xml");
}
else if(oBrowser == "IE") {
dom = GXml.parse(XmlRequest.responseText);
}
Then we add the MIDAS ‘monuments’ element to a local var:
var monuments = dom.getElementsByTagName("monument");
Next we loop through the monuments collection and process each record:
for (var j = 0; j < monuments.length; j++) {
var oItem = monuments[j];
// strip out whatever the application needs from MIDAS
}
We can then assign various nodeValues from the individual ‘monument’ elements to local vars in Javascript which we use to populate the GoogleMap with markers and tooltips and InfoWindows.
Since the MIDAS XML schema uses the National Grid Reference as a spatial reference, we need to convert it on the fly in Javascript to Latitude and Longitude, which is how the Google Maps API plots spatial references on the interface.
Once more XML files become available using MIDAS schema it would be a simple process to provide a method to overlay different sources on top of each other and toggle them on/off using Javascript.
This client-side method of retrieving data from MIDAS documents has only been tested on small MIDAS datasets. If the datasets where large then this method would cause the client browser to freeze. For larger datasets it would make more sense therefore to use server-side code to parse the MIDAS XML and return the data back out via the same XMLHTTP client-side call. This could be achieved by doing all of the server-side processing in the server-side page we are using for a proxy call to get the XML from another domain.
The Google Maps API is still in beta, meaning that it has not been formally released as a product. As such, it is still being developed, and new features are still being added weekly.