A. 如何把xslt利用js生成二維碼
avascript代碼如下:functioninitialize(){varxmlDoc;varxslDoc;//判斷瀏覽器的類型if(document.implementation&&document.implementation.createDocument){//支持Mozilla瀏覽器try{xmlDoc=document.implementation.createDocument(,,null);xmlDoc.async=false;xmlDoc.load(guestbook/guestbook.xml);}catch(e){alert(error:001);}try{xslDoc=document.implementation.createDocument(,,null);xslDoc.async=false;xslDoc.load(guestbook/guestbook.xsl);}catch(e){alert(error:002);}try{//定義XSLTProcessor對象varxsltProcessor=newXSLTProcessor();xsltProcessor.importStylesheet(xslDoc);varoResultFragment=xsltProcessor.transformToFragment(xmlDoc,document);//將解析過的文本輸出到頁面varoDiv=document.getElementById(guestbookPanel);oDiv.appendChild(oResultFragment);}catch(e){alert(error:003);}}elseif(typeofwindow.ActiveXObject!='undefined'){//varxmlDoc=Server.CreateObject(Msxml2.DOMDocument.4.0);//支持IE瀏覽器xmlDoc=newActiveXObject('Microsoft.XMLDOM');xslDoc=newActiveXObject('Microsoft.XMLDOM');xmlDoc.async=false;xslDoc.async=false;xmlDoc.load(guestbook/guestbook.xml);xslDoc.load(guestbook/guestbook.xsl);