XML
the DOM (Document Object Model) is a W3C (World Wide Web Consortium) standard. A DOM defines a standard way for accessing and manipulating documents like XML and HTML.
// parses an XML document into an XML DOM object
function loadXMLdoc(datafile) {
//Create an XMLHTTP object
//Open the XMLHTTP object
//Send an XML HTTP request to the server
//Set the response as an XML DOM object
if (window.XMLHttpRequest) {
xmlhttp = new XMLHttpRequest(); // creating an XMLHttpRequest object
} else {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); // for IE6
}
xmlhttp.open("GET",datafile,false); // open the object
xmlhttp.send(); // send a request to the server
return xmlhttp.responseXML; // the XML DOM object created by the parser
}
XML is used to transport data, while HTML is used to format and display the data.
a partial discography
the following 7 rows of data live in a little xml file.
the XML DOM defines a standard way for accessing and manipulating XML documents.
the XML DOM defines the objects and properties of all XML elements, and the methods to access them.
an XML document must be loaded into an XML DOM object before it can be accessed. the XMLHttpRequest object is the way to load external XML data into the browser.
RSS
RSS uses a standardized XML file format allowing the information to be viewed by many different programs.