// In this sample, we have an XML file as follow:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<DATA>
<ITEM>A</ITEM>
<ITEM>B</ITEM>
<ITEM>C</ITEM>
<ITEM>D</ITEM>
</DATA>
// The JavaScipt code to retrieve the content of the tag VERSION
// is as follow:
mioxml_download("www.mioplanet.com/data.xml", "xml_data_loaded");
// Download completed...
function xml_data_loaded(status) {
if(status == 1) {
item = mioxml_getElementArray(MIO_XML.xml, "ITEM");
alert(item[0]);
} else {
// Failure: can be a wrong URL or an error in the XML file
alert("Failure");
}
} |