Hi list, this is not exactly a XSLT question but I hope that anybody can
help me.
I'm loading from Javascript an XML and I transform this XML. I build the XML
with PHP querying a BD but my XML delays a few seconds. I want to put a
progress bar while the XML loads and finally transform it with my XSLT but I
don't know how I can do this. Is there any property or similar to control
the XML time. I know the "onreadystatechange" and "async" propertys but I
don't know if there is another function or If I can do something with this.
I have a Inc() function to incrementate my progress bar.
This is the first time I work with XSLT and my code works fine but I don't
know if is the best way to transform the XML... Any sugestion about my code
and about the progress bar, please ??.
Thanks a lot in advance.
This is my code:
function TransformXML(Order,NumberPage,MaxPerPage){
XSLStylesheet = new ActiveXObject("Msxml2.XSLTemplate");
XSLStylesheet.stylesheet = XSLDOM;
XSLTProcessor = XSLStylesheet.createProcessor();
XSLTProcessor.input = XMLDOM;
XSLTProcessor.addParameter('sortMethod', Order);
XSLTProcessor.addParameter('RecordsPerPage', MaxPerPage);
XSLTProcessor.addParameter('PageNumber', NumberPage);
XSLTProcessor.transform();
try{
DivTablaPrecios.innerHTML=XSLTProcessor.output;
}
catch(e){
alert('Error!');
document.open();
document.write(XSLTProcessor.output);
document.close();
}
}
function CheckXML_XSL(){
if ((xml_datosXML_completo == true) && (xml_datosXSL_completo == true)) {
DivLoading.style.display = 'none';
DivTablaDisponibilidad.style.display = 'block';
TransformXML(3,1,10);
}
}
function DoXSLComplete() {
if (XSLDOM.readyState == 4) {
xml_datosXSL_complete = true;
CheckXML_XSL();
}
}
function DoXMLComplete() {
if (XMLDOM.readyState == 4) {
xml_datosXML_complete = true;
CheckXML_XSL();
}
}
function LoadXSLT() {
xml_datosXSL_completo = false;
XSLDOM = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
XSLDOM.onreadystatechange = DoXSLComplete;
XSLDOM.async = true;
XSLDOM.load('<?echo $my_XSLT_Path;?>Disponibility.xslt');
}
function LoadXML() {
xml_datosXML_completo = false;
XMLDOM = new ActiveXObject("Msxml2.FreeThreadedDOMDocument");
XMLDOM.onreadystatechange = DoXMLComplete;
XMLDOM.async = true;
XMLDOM.load('<?echo $my_XML_Path;?>Disponibility.xml');
}
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list