The mozilla XSLT client side is not visible. (With jQuery too)

I want to use firebug for debugging and help quickly complete some XSLT hosting issues, but I can't seem to get the following code to execute and render the XSLT client-side in Firefox (ok in IE):

$().ready(function() {

   var oXMLHTTP
   var oXSLT

   if ($.browser.mozilla){
     oXMLHTTP = document.implementation.createDocument("","",null);
     oXSLT = document.implementation.createDocument("","",null);
   }else{            
     oXMLHTTP = new ActiveXObject("Microsoft.XMLDOM");
     oXSLT  = new ActiveXObject("Microsoft.XMLDOM");
   }
   oXMLHTTP.async = false; 
   oXSLT.async = false;
   oXSLT.load('Layout.xslt');

   var sURL = "somepage"

   /**/
   $.get(sURL,function(data){
      var sTranformedXML = "";
      if ($.browser.mozilla){
         oXMLHTTP.load(data);
         var xsltProcessor = new XSLTProcessor();
         xsltProcessor.importStylesheet(oXSLT);
         var mDoc = document.implementation.createDocument("","",null);
         sTranformedXML = xsltProcessor.transformToFragment(oXMLHTTP,mDoc);
      }else{
         oXMLHTTP.loadXML(data);
         sTranformedXML = oXMLHTTP.transformNode(oXSLT)
      }
      $("#main").html(sTranformedXML);
      $("#tbl_Not Grouped").insertAfter("tbl_Social Sciences");
   })// $.get           
})

      

Is there something I am missing here?

I really only need to test the Firefox code. So it doesn't have to be pretty.

+1


source to share


2 answers


Gecko's XSL-T implementation is known to incorrectly handle default namespaces. Try prefixing elements in XML document and / or prefixing elements in XPath queries in XSL document (remember to concatenate new prefixes)



+1


source


This doesn't really answer your question per se, but you might consider taking a look at Google's AJAXSLT, which wraps various browser capabilities and "fills in the blanks": link



+1


source







All Articles