I've tried the code below to work on my page.They just works good but not effective enough.Everytime the activex object is created,the
js retrieve xsl file and files inclued in it from server and that terribly do harm to the efficiency of the system.Because my server is embeded in some kind of equipment.So ,is there is a way that I can create the xslt object using files obtained from the IE cache when they were first loaded in the cache ,just like othe cgi requests do?
.................................................. ..............
function createXSLDOM() {
var arrSignatures = ["Msxml2.FreeThreadedDOMDocument.6.0","Msxml2.F reeT hreadedDOMDocument.5.0", "Msxml2.FreeThreadedDOMDocument.4.0",
"Msxml2.FreeThreadedDOMDocument.3.0", "Msxml2.FreeThreadedDOMDocument.2.0",
"Msxml2.FreeThreadedDOMDocument"];
for (var i=0; i < arrSignatures.length; i++) {
try {
var oXslDom = new ActiveXObject(arrSignatures[i]);
return oXslDom;
} catch (oError) {
//ignore
}
}
throw new Error("MSXML is not installed on your system.");
}
function loadAreaPage(areaObject,xmlName,xslName,callback){
var xslDoc = createXSLDOM();
var xmlDoc = createXMLDOM();
try{
xmlDoc.async=true
xslDoc.validateOnParse=false
xmlDoc.load(xmlName)
xmlDoc.onreadystatechange=function(){
if(xmlDoc.readyState==4){
xslDoc.load(xslName)
}
}
xslDoc.onreadystatechange=function(){
if(xslDoc.readyState==4){
if(!xslDoc || !xmlDoc || xslDoc.text.length==0){
xmlDoc=null
xslDoc=null
return
}
areaObject.innerHTML=xmlDoc.transformNode(xslDoc)
xmlDoc=null
xslDoc=null
try{
callback()
}catch(exc){}
}
}
}catch(exc){}}
.................................................. ..............
Tks,everybody and wait......